[RESOLVED] big chunk of data in winsock
hi,
my winsock can receive a max data of 8192 bytes but in real the data is more than that. so, only the data < 8192 bytes are processed while the rest are simply cut off.. so, can any body provide me a working tutorial or code such that i can understand how to overcome this situation.
thanking you in advance :)
Re: big chunk of data in winsock
I take it you're using the UDP protocoll then?
If you continously read from the socket buffer to make sure that there's room for the next load of data, you'll be safe from having packets dropped.
What language are you using?
Re: big chunk of data in winsock
i am using tcp data, and yes i have added buffer but the thing is buffer works only for data less than 8192 bytes like i have mentioned.i am using vb6
Re: big chunk of data in winsock
TCP shouldnt overflow the buffer and cause packet loss. If thats the case then something is fundamentally wrong in one of the end hosts. Because I take it that by "cut off" you mean that packets are being dropped?
Re: big chunk of data in winsock
If you still want to change the socket buffer you'd have to use the setsocketopt API, as explained on this page:
http://support.microsoft.com/kb/237688
Altough depending on the answer of the question in my last post, it may not be needed.
Re: big chunk of data in winsock
My guess is that you're doing something wrong on the receiving end or maybe the sending end...no data should be getting cut off...
Also, TCP splits data up into chunks that are usually 4096 bytes (4KB) or maybe it is 8KB, I forgot. So you should never use that much on a single .SendData call. But it still shouldn't cut anything off...
You'll need to post your code...
Re: big chunk of data in winsock
All right Guitar & Atheist lemme upload my code. i have well commented on what i am trying to do in data arrival and packet parsing ..rest should be understood . .both client/server are in the same project .one single data that the server sends contains 88 bytes ( i am using just one type of tcp data). my client can handle up to (93 tcp packets arriving at the same time) which is (93 * 88 = 8184 bytes) but i get error on the 94 th packet as it is greater than 8192 bytes like i mentioned before..
Re: big chunk of data in winsock
anywayz i figured a way out..now there are not any truncated data ......even if there are hehe :) my code can handle them.. ..thanx to DigiRev .m uploadin my project, it can be useful for handling tcp data..this is a neat example of buffering. ..i am just using the string function but i understand there is a way to speed up using byte arrays which i am quite unfamiliar with .thanx to all :)