in reply to How to answer a UDP broadcast
Datagram sockets aren't two way. Are you sure you're stuck with UDP? Its not good for 2 way traffic, because to do the opposite of what you just did (sending or recieving) you need to open a new Socket. You also cannot listen on a broadcast socket.
My advise would be to use TCP unless there are multipule things that need to listen to the broadcast. TCP was meant for 2 way confirmed communication, and you will find that your life of network communication will be made much easier.
Also as a matter of style mixing confess and die and ways of checking for success (using an inline or vs assigning and then checking if it's not defined) generally makes the code more difficult to read.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to answer a UDP broadcast
by mje (Curate) on Jun 19, 2007 at 19:50 UTC | |
by Trizor (Pilgrim) on Jun 19, 2007 at 20:41 UTC | |
by mje (Curate) on Jun 19, 2007 at 21:13 UTC | |
by Trizor (Pilgrim) on Jun 19, 2007 at 22:56 UTC | |
by eric256 (Parson) on Jun 20, 2007 at 00:11 UTC | |
by idsfa (Vicar) on Jun 20, 2007 at 14:40 UTC | |
by mje (Curate) on Jun 21, 2007 at 10:13 UTC |