|
-
Oct 17th, 2006, 01:44 PM
#1
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:
Dim SendCompleteTCP as Boolean
Dim Message as String
Public Sub WinsockTCP_senden(Verbindung As Integer, Message As String)
SendCompleteTCP = False
WinSockTCP(Verbindung).SendData Message
Do
DoEvents
Loop Until SendCompleteTCP = True
End Sub
Private Sub WinSockTCP_SendComplete(Index As Integer)
SendCompleteTCP = True
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!
-
Oct 17th, 2006, 02:41 PM
#2
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...
-
Oct 17th, 2006, 02:54 PM
#3
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!
-
Oct 17th, 2006, 03:09 PM
#4
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.
-
Oct 17th, 2006, 03:16 PM
#5
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
|