Results 1 to 5 of 5

Thread: UDP connection doesn't fire _sendcomplete?

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Resolved UDP connection doesn't fire _sendcomplete?

    Hi,I'm using the following code for an array of TCP connections.
    It prevents errors from a blocked connection if a second message has to be sent through that WinsockTCP array. That works so far.
    But I tried to use the exact same with a UDP connection, the problem seams to be that the WinSockUPD_SendComplete(Index As Integer) Sub never fires. Why is that?

    VB Code:
    1. Dim SendCompleteTCP as Boolean
    2. Dim Message as String
    3.  
    4. Public Sub WinsockTCP_senden(Verbindung As Integer, Message As String)
    5. SendCompleteTCP = False
    6. WinSockTCP(Verbindung).SendData Message
    7. Do
    8.     DoEvents
    9. Loop Until SendCompleteTCP = True
    10. End Sub
    11.  
    12. Private Sub WinSockTCP_SendComplete(Index As Integer)
    13. SendCompleteTCP = True
    14. End Sub
    Last edited by opus; Oct 17th, 2006 at 02:54 PM.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: UDP connection doesn't fire _sendcomplete?

    I never actually tried to see if SendComplete fires with UDP, but it makes sense if it does not fire.

    UDP is a connectionless protocol, therefore it does not do any checking if it was actually sent or not.
    Since it won't know if the packet was sent, it will never fire the SendComplete event...

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: UDP connection doesn't fire _sendcomplete?

    I was thinking the same, but I thought that if the Event is buid in, it should fire.

    But thinking wasn't one of my favorites.

    I guess I'll keep the errrors when sending stuff over the UDP winsock, it only happens on my development-pc. There I have all the client on one PC and I can'T use the Broadcast method. On real net the error doesn't happen.

    Thank'S anyway
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  4. #4
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: UDP connection doesn't fire _sendcomplete?

    The events fire depending on how you use the control, for example:

    Using TCP on the server side, you never get a "Connect" event, instead you get a "ConnectionRequest"
    On the client side, it is the reverse, you never get a "ConnectionRequest" event, but you get a "Connect" event.

    Also, when you close the connection using Winsock1.Close, the Close event does not fire, but it does fire when connection is closed by the other side.

  5. #5

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: UDP connection doesn't fire _sendcomplete?

    That's understood, but for my problem I think the _sendcomplete should be raised on the sending side of the Winsock control.
    BTW all the other sending/recieving stuff on TCP and UDP are running smooth (i.e. I got it running so far). I'm using ErrorLogs the give me hints if there is a problem somewhere. The problem above does show only when running the applications all on one machine (UDP messages serialised not via Broadcast) and it nomally happens only once during runtimes of upto 60 minutes. in other words I can live with that.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

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