Re: [twsocket] When receiving UDP datas, find if there were sent through a broadcast

2014-02-26 Thread Eric-Lionel Rault

I don't think this exists. However, I see two solutions for your problem:
One easy and one more complex.
1) Easy: In the data packet you send, add the server address. Those not
having that address will then easily detected. This is easy but required 
to

somewhat change the protocol you use and this may not be possible for you.


Good news, i found out that in my data packets, i had already a flag for 
that !



2) Complex: Use a second TWSocket in raw mode to get hand on all packets.
You can then peek in the raw packet to find the destination address which 
is

255.255.255.255.


Complex, i agree 



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] When receiving UDP datas, find if there were sent through a broadcast

2014-02-25 Thread Angus Robertson - Magenta Systems Ltd
 I have a server with an UDP socket listening.
 Some Clients connect with the Ip address of the server : Direct 
 Addressing.
 Some Clients do not know the Ip address of the server, therefore 
 they connect by sending a broadcast.
 In OnDataAvailable event, i would like to know which Clients have 
 been connected through a broadcast.

I don't believe there is anything in the IP protocol that will identify a
broadcast.  So you can either arrange the clients tell you as part of the data
you send, use a different port for broadcasts, or keep track of the IP
addresses locally (if you know already). 

In DataAvailable, you can use ReceiveFrom the get the IP address of the remote
client. 

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be