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
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...
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
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.
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. :afrog: