| Dart Home | PowerTCP Winsock for ActiveX | Custom Development | Reply | PowerTCP Winsock for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Winsock for ActiveX Topic: UDP Receive event continuously firing |
| Van^ From: Blacksburg, VA USA Posts: 17 Member Since: 09/04/03 |
posted September 4, 2003 2:18 PM Hi, I'm using the UDP object and I'm curious about something. The Receive() event keeps firing even though there is no data in the buffer. Here is the code I have: Private Sub oDartUDP_Receive() Dim bytData() As Byte Dim lngLen As Long Dim strRemoteHost As String Dim lngRemotePort As Long lngLen = oDartUDP.Receive(bytData, strRemoteHost, lngRemotePort) Debug.Print "The receive event! Len = " & lngLen & ", RH = " & strRemoteHost & ", RP = " & lngRemotePort If lngLen > 0 Then 'Do something with the data End If End Sub Once it starts receiving data, this event seems to fire even when there isn't a datagram waiting in the buffer. Is this the correct behavior? If so, it seems like there is a polling timer that is firing every so often and firing that event. Wouldn't that be a waste of processing power? --Van^ |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 4, 2003 2:24 PM The only time that should happen is if all the data was not received. Does this happen all the time or once in a while? I'll need a way to duplicate. |
| Van^ From: Blacksburg, VA USA Posts: 17 Member Since: 09/04/03 |
posted September 4, 2003 2:41 PM This happens all the time. I have a very small test project created that will reproduce this on a windows 2000 platform (and XP). If you would, like, I can send it to you. I'm wondering if it has anything to do with the fact that I'm grabbing data with byte arrays and not strings. --Van^ |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 4, 2003 2:47 PM Well, thats easy enough to test. What happens when you try that? |
| Van^ From: Blacksburg, VA USA Posts: 17 Member Since: 09/04/03 |
posted September 4, 2003 2:54 PM I changed the reception data item to a string and it was still occurring. Any suggestions? --Van^ |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 4, 2003 2:57 PM Please zip the sample up and email it to support@dart.com with a subject "Files for topic 3449" |
| Van^ From: Blacksburg, VA USA Posts: 17 Member Since: 09/04/03 |
posted September 4, 2003 3:08 PM The email is on the way. Hopefully, we can resolve this. I'm looking at replacing our current UDP control with yours. We need to be able to retrieve the data in Byte() format. The one that we have only supports variant array and String. On a side note, it does seem that the one that we currently have is a bit faster than yours. I'm wondering if this is due to some internal buffering that is being done. I'm writing a data streaming application and and I'm able to send quite a bit more with the previous control than yours. --Van^ |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 4, 2003 3:41 PM Actually I think I remember something about this now. I don't remember the KB article number, but as I recall in the stacks after 2000 when you send data to a UDP socket that is not open, you will get a "NULL" receive event. That is EXACTLY what is happening to you. If you stop sending when you get the null data the first time it should work. In other words, consider getting null data to mean that the remote host is not on. In regards to the performance problem, please relay the details to David Harry who will be calling you shortly. |
| Reply | PowerTCP Winsock for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|