Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
First let me start off by saying that I have dealt with Winsock for MANY years and am attempting to convert my project over from vb6 to VB.Net.

This program was made to handle up to 70 connections at a time and constantly sending data from Server to clients and back.



There is one packet however, that reaches up to be around 177kb when sent. The sockets are set up to sent 1kb at a time.... (No other packet actually uses the whole kb). It seems that after the server sends this large packet... the client receives the data out of order. After debugging and monitoring I find that it normally happens between 3-4kb. While the first 3 are good and in order.



My question is, is there a different system I should use instead of just Sockets (I have had similar problems with TCPClient) and/or can someone maybe link me to a sample project that would not have this error?



Thanks!
Posted

1 solution

When just using sockets (just IP) it is possible for receiving datagrams out-of-order. When using the Transport Control Layer the segments of these datagrams are ensured to be in-order. You should use TCP on both ends to ensure that it works correct. You mention that you use TCPClient but do you also use TCPServer? When using TCP the problem of receiving data out-of-order is solved.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900