CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: winsock send

  1. #1
    Join Date
    Mar 2000
    Posts
    29

    winsock send

    hi, i have been making a program to accept multiple connections. i have succeeded in doing this but i have ran across a problem. when you have the winsock sends two or more lines of data without a pause in between the client user receives them in one big packet or not at all i dont like to use the pause because this type of application will be to slow to use! any ideas on how to fix this? thanks


  2. #2
    Join Date
    Nov 1999
    Location
    NY
    Posts
    906

    Re: winsock send

    You should device your own little protocol for this.

    The simplest scheme will be to always send an integer first that holds the length of the string that follows.

    Clients should receive the integer first and then read the exact number of bytes from the socket to get the packet.

    Kailash


  3. #3
    Join Date
    Mar 2000
    Posts
    29

    Re: winsock send

    yea but since the packets seem to go into one packet then it will only read the first part and the rest is lost!??


  4. #4
    Join Date
    Nov 1999
    Location
    NY
    Posts
    906

    Re: winsock send

    The client should keep trying to read data until something else tells it to stop / terminate.
    Kailash


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

Featured