VB.NET Socket stream reliability 
Author Message
 VB.NET Socket stream reliability

Hello all

I got a tricky one here.

I wrote an application in VB.NET to stream MP3's to a particular port
on a particular server. My problem is the MP3's are a little bit
choppy and they contain rand squeals..this is  a result of the stream
getting corrupted between the two points or a timing issue.

NOw, I've done the same exact thing with PHP, Python, and JAVA talking
to the same server, over the same network, from the same source.
Neither socket libaries in these languages had these problems.

Here is my simple code below, and again I've done the Java, python and
PHP equivelent of what you see below with no issues:

Dim BR As New IO.BinaryReader(IO.File.OpenRead(sFile))
Do Until BR.Read = -1
     BR.Read(buffer2, 0, bufferlen)
     networkStream.Write(buffer2, 0, bufferlen)
     meThread.Sleep(1000) ' Sleeps for 1 seconds
Loop

Are there any known issues with the .NET socket libaries? I tried
playing with the SendBufferSize and NoDelay properties of the
TCPClient object, but they made no differnece.

Any information would be helpful. Thanks!!



Mon, 18 Apr 2005 10:17:46 GMT  
 VB.NET Socket stream reliability
Why are you sleeping the thread?


Quote:
> Hello all

> I got a tricky one here.

> I wrote an application in VB.NET to stream MP3's to a particular port
> on a particular server. My problem is the MP3's are a little bit
> choppy and they contain rand squeals..this is  a result of the stream
> getting corrupted between the two points or a timing issue.

> NOw, I've done the same exact thing with PHP, Python, and JAVA talking
> to the same server, over the same network, from the same source.
> Neither socket libaries in these languages had these problems.

> Here is my simple code below, and again I've done the Java, Python and
> PHP equivelent of what you see below with no issues:

> Dim BR As New IO.BinaryReader(IO.File.OpenRead(sFile))
> Do Until BR.Read = -1
>      BR.Read(buffer2, 0, bufferlen)
>      networkStream.Write(buffer2, 0, bufferlen)
>      meThread.Sleep(1000) ' Sleeps for 1 seconds
> Loop

> Are there any known issues with the .NET socket libaries? I tried
> playing with the SendBufferSize and NoDelay properties of the
> TCPClient object, but they made no differnece.

> Any information would be helpful. Thanks!!



Mon, 18 Apr 2005 22:18:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to use the system.net.sockets and system.net in VB.net

2. VB.NET system.net.sockets question

3. Trouble with System.Net.Sockets.Socket under Windows 98

4. System.Net.Sockets.Socket Problem

5. System.Net.Sockets.Socket State

6. system.net.sockets.socket async server example

7. Detect Remote Disconnection System.Net.Sockets.Socket

8. System.Net.Sockets.Socket.EndReceive has a bogus return value

9. Socket Receive - Force to wait for complete stream??

10. serilaizing objects and streaming though a socket

11. Newbie: Retrieving Binary Stream from IP-Socket

12. Using SharpZipLib To Get a Zipped Stream (VB.Net)

 

 
Powered by phpBB® Forum Software