What if RecievedBufferSize is too small?

bonedoc

Well-known member
Joined
May 4, 2006
Messages
112
Programming Experience
Beginner
I am reading images from a stream. Many of them are bigger than 8193, and I am calculating the buffer size by the .RecievedBufferSize property. This cuts the image off if it is too big. What can I do to get a proper size? Do I just create a huge buffer and hope it covers it?
 
Just keep on reading if available, it's a stream and it goes on and on until it stops.
You can send size first and use this for reciever to know what to expect. Integer datatype is 4 bytes, Long datatype is 8 bytes.
You should look into serialization, by the way, makes communication easier, there is some example projects attached down at this thread: http://www.vbdotnetforums.com/showthread.php?t=11783
 
Back
Top