----- Begin original post -----
Greetings!
Well, I've been back in the PureBasic world for a while now and things are progressing nicely. So far everything I have been testing has been working in Windows and on the Mac.
One little difficulty that I have encountered is with regards to UDP communications. Here's the scoop:
The background is I have to send from the PC an "I'm ready" broadcast packet from port 50500 to port 50501 and almost immediately I will receive an "We're Here" UDP response from all listening devices back on port 50500. These devices also periodically send out the same packet every couple of minutes.
I have created the network server to receive the packets and that seems to work perfectly. I am able to get the periodic device messages and process them.
So far, so good, but here is the catch: When I send the "I'm ready" message, I'm not getting the responses that I just received.
What it seems to me is that when send a message on a particular UDP port, I cannot receive any messages on that port for a brief period of time. (I am guessing this quiet period to be able two seconds but I could be very wrong on that.) Now after that period of time had passed, I have no issue in receiving the page that are sent out periodically.
Thanks to Fred adding the ability to specify the originating port, the program appears to be sending packet correctly according to WireShark. Also according to WireShark, the devices are sending their responses. It's just that I'm not getting a packet notification.
Referring to the attached screen shot from WireShark, here is a chronology as to what is happening:
- Record 19 - I sent the "I'm ready" packet from .120 to .255
- Record 20 - 1/100th of a second later, WireShark sees the "We're here" packet from .147 but my program does not
- Record 112 - 30 seconds later, .147 says "We're here" again and this time my program does receive it
- Record 115 - My program interprets the packet, decides to establish communications and sends this packet direct from .120 to .147 with instructions to establish the TCP connection
- Record 118 - TCP communications commence between the PC at .120 and the device at .147; the program is working as it should
- Record 122 - The device at .147 sends its first data packet to the PC at .120; the program is also working as it should

Screen shot link: http://www.bullthumper.com/images/wireshark-udp.png
One thing I have tried was to close the server established by CreateNetworkServer(), send the packet and then re-open the server, just in case there was some limitation, but interesting the characteristic seems to be same, or at least similar.
I'm not sure where to go in diagnosing this and am wondering if anyone has any ideas or suggestions. Also, if I need to provide more information, just let me know and I will try to oblige.
Thanks in advance for your help,
Dan

