|
-
Dec 4th, 2008, 04:18 AM
#1
Thread Starter
Lively Member
Sending Data too fast?
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
Last edited by s021126; Dec 4th, 2008 at 04:22 AM.
-
Dec 4th, 2008, 05:11 AM
#2
Re: Sending Data too fast?
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:
VB.NET Code:
sockMain.SendData "T,"
sockMain.SendData HP.Caption
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.
-
Dec 4th, 2008, 09:04 AM
#3
Thread Starter
Lively Member
Re: Sending Data too fast?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|