Byte problem.

georgepatotk

Well-known member
Joined
Mar 1, 2004
Messages
431
Location
Malaysia
Code:
                Dim fstream As FileStream = File.OpenRead(ServerStoragePath & "/" & filepath)
                Dim bytedata() As Byte
                bytedata = New Byte(fstream.Length) {}
                fstream.Read(bytedata, 0, bytedata.Length)
                fstream.Close()

                networkStream.Write(bytedata, 0, bytedata.Length)

The above code is to send a file across the network.
I have a problem where small file is able to be sent but large file will generate error.

The error message is :
Code:
An unhandled exception of type System.IO.IOException occurred in system.dll

Additional information: Unable to write data to the transport connection.

Could u please tell me what is the problem actually?

George Low
 
How large a file (roughly) breaks the system? Also, could you not break the file down into smaller chunks and send those instead?

You may want to look Here, for a sample that does simple transfer of files.
 
For ur information, i didnt break the file at all. i send it as byte and the byte is direct from the file.
i send file with 20mb to 80mb, it works.
when i send more than 90mb, it breaks.
 
Hmm, strange thing is Im getting this error on my laptop yet it worked at home - however I am experiencing other network oddities on this PC.
Having rummaged around the internet a couple of things seem to cause this to occur

http://support.microsoft.com/default.aspx?scid=kb;en-us;815209 being one of them. Also http://support.microsoft.com/?id=826757 may be of some use.

Ive also seen the odd report of AV software causing this - if you are running any it may be worth disabling it to see if that helps.
 
Back
Top