Results 1 to 3 of 3

Thread: Sending Data too fast?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    96

    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.

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    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:
    1. sockMain.SendData "T,"
    2. 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.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    96

    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
  •  



Click Here to Expand Forum to Full Width