After carefully examining the problem in a few different internet cafes yesterday, I determined that the problem is most likely happening because the connection is just dropping after a while. That is, the socket is no longer connected to the stream's source.
My solution to this problem is to use non-blocking sockets, and wait for up to a second to recv data from the server. If nothing is found after a second, the connection is dropped, and I establish connection again. So when it happens, you are going to hear a few seconds of garbage, but it will sort itself out in the end.
I don't think that there's honestly anything I can do about this at this stage of the game. The same network code I'm using on my DS works just fine on my Linux test app. Which leads me to believe that this is a library problem. So... I'm lifting the request for secrecy, as there's not much else I can do with it right now, besides making the other stuff better (see the TODO list for planned features, not sure when I can get around to them though).
Anyways, for those of you with good connections, I hope that this is useful. (I'll try it out at my University later, which is my real concern).
EDIT: Inferno, I am well aware that my buffering system sucks. This release is just to say "this works". Next release might do things a little nicer, such as pausing when buffering, and starting when buffering is finished, just like a real music player. There's a long way to go, and a lot of code to write... But I'm pretty sure I can do it. (Again, not sure of the timeframe on that though)
EDIT2: Just had a look at sgstair's checklist. Seems that the relevant bugs are:
# TCP connection closing errors (working on this)
# Latency issue, something is causing the lib to have higher pings after a while (unclear on what causes this, but I have a few ideas, I'll look at it.)
# TCP loses data apparently when rx buffer is filled (probably fixed, testing.)
# possible bug with recv not returning data it should, will look into this (unsure)
# check/fix blocking TCP recv (next release)
When these are fixed, my app should function much more closely to as advertised.
Edited by Grey, 18 May 2006 - 11:23 AM.