Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: socket
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 10-Oct-10 5:51am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 385
1 Sergey Alexandrovich Kryukov 329
2 CPallini 270
3 DamithSL 214
4 Maciej Los 192
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 11 Oct 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100