sockMain.SendData "T"
sockMain.SendData HP.Caption
When I use winsock to send data continuously, the data receive will be combined.
How to solve this problem???
Is I need to delay the message? If it does, how to implement it?
Thank YOU
Printable View
sockMain.SendData "T"
sockMain.SendData HP.Caption
When I use winsock to send data continuously, the data receive will be combined.
How to solve this problem???
Is I need to delay the message? If it does, how to implement it?
Thank YOU
Thats the problem when people think they are sending 1 packet for each call to the Send method, and that they're receiving 1 packet at a time at the receive event.
You're not sending data too fast, this is just how it works.
When you push data down to the lower layers of the network, your data will be chopped up and placed in TCP segments and finally in packets as the TCP/IP implementations see fit. And thus, it'll could arrive on the receiving host in 1 packet, 2 packets...who knows? Thats something programmers need not be conserned of.
You should always create your own logic to separate data at the receiving end, an example would be a comma:
Now when you receive the data combined at the receiving host, you'll still know that it is made up of 2 separate messages because of the comma in it.VB.NET Code:
sockMain.SendData "T," sockMain.SendData HP.Caption
I understand now. Thank you all of you
But, the school textbox tells me that tcp divide the message into packets and send it,IP route the packets and last combine all packets at the destination