Results 1 to 6 of 6

Thread: DataArrival Event / Winsock

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Ottawa, ON. Canada
    Posts
    13

    Unhappy

    I am having problems with the dataArrival event on the server side of a winsock connection.

    I have a loop on the client side, sending an byte array of 4096 bytes at a fairly constant rate.

    My problem is that after a random number of calls to the dataArrival event by the server, it is not receiving all of the data. For example after 10 loops on the client side (sending data), the dataArrival will be called after only receiving half of the data.

    Anyone know about this problem?? Or when dataArrival is supposed to be called (ie. When the first bit of data arrives, all the data, half way...)??

    I've been stuck on this bug for 3 days. I need help!!

    Thanks!

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    I've just sterted using winsock and it could be because you are sending to much data too quick for the client to be able to hanlde with ???

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Ottawa, ON. Canada
    Posts
    13
    I don't know because I'm not sure what happens when you send too much data to be processed. I think it must be put on a stack at the client end, waiting to be processed. Sending too much data doesn't seem to be a problem, it processes it fine. The problem is when the DataArrival event is called when the full packet (4096bytes) hasn't arrived.

  4. #4
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    When you use winsock there is a function to do with data arrival and there is a string to do with bytes use that so that if the number of bytes = the amount you want it will do what you want :

    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    If bytesTotal = 4096 Then
    'Put Stuff Here
    End If
    End Sub

  5. #5
    New Member
    Join Date
    May 1999
    Location
    Cordoba, Argentina
    Posts
    15

    Arrow

    Someone tell me about a bug of Winsock, and the solution was insert DoEvent follow SendData, in order to clear buffer of Winsock packets. I hope you find the final solution.
    Good luck !

  6. #6
    New Member
    Join Date
    May 2000
    Location
    Auburn,AL
    Posts
    12
    I had the same problem with winsock a couple of months ago. The problem I faced was that the timer event I was using to send data was being executed too quickly for the winsock control. I eventually had to lower the resolution to 200ms.
    A better solution I found was to use National Instruments' DataSocket control to pass data. This control connects similar to winsock, but allows for near-real-time transfer of data between client and server.

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