Subject: Get Local end point Ip address
Hey Alex, I need to manage the fact that users have multiple ip adresses(WIFI + CABLE) so I'm asking if there's anyway how to get the ip address that the client using to connect to the server
I tracked the sender object in :
it seems that he have the attribut _socket (but only in the debugging mode) which have the LocalEndPoint that conatians the ip address , the problem that I'm facing is when I try to cast the sender to a System.Net.Sockets.Socket object it triggers an error.
I'm asking on how to get the LocalEndPoint from the sender?
YOUSSEF RHAIBI
I tracked the sender object in :
- private void ClientSocket_OnReceive(object sender, byte[] data, int count)
- {
- if (InvokeRequired)
- {
- // Windows Forms are not Thread Safe, we need to invoke this :(
- // We're not in the UI thread, so we need to call BeginInvoke
- BeginInvoke(new agsXMPP.Net.ClientSocket.OnSocketDataHandler(ClientSocket_OnReceive), new object[] { sender, data, count });
- return;
- }
it seems that he have the attribut _socket (but only in the debugging mode) which have the LocalEndPoint that conatians the ip address , the problem that I'm facing is when I try to cast the sender to a System.Net.Sockets.Socket object it triggers an error.
I'm asking on how to get the LocalEndPoint from the sender?
YOUSSEF RHAIBI