TcpClient and TcpListener: host based control.

  • Thread starter Thread starter Maxim Kovgan
  • Start date Start date
M

Maxim Kovgan

Hello, Dear experienced!

i am writing an app which uses the Wireless LAN as the medium
and of course it is over TCP/IP.
wanted to add host based access control. but i don't seem to find a way
to find out who is the client that connects to my listener.

how can i discover this ? is there a way ?
is there some kind of netstat data that is parsed into some .NET CF
interface ?
anything ?

Thanks in advance.

Max.
 
What information from the client are you looking for, exactly? IP address?
Host name? What?

Paul T.
 
For example, if you have Accept-ed connection on your listener, you can get
the RemoteEndpoint, cast it to an IPEndPoint and get its Address and Port
properties...

Paul T.
 
***Code to do what?*** Answer my questions from the first reply and maybe
someone will give you some code but right now, we don't know what you want
the code to do.

Paul T.
 
i needed to see the ip of the remote client
from what i understood, i can access this information vi
class Socket and not TcpClient or TcpListener directly
[i don't understand the class assumption: if programmer doesn't want/need to mess with socket
setup, set/getsockopt/select etc., why not to allow the programmer to know who's has connected ?
anyway, thank you for your help
M.
 
You need a connected socket to get the IP of the other end of the
connection, yes (it's only logical). The underlying sockets API does not
expose a means to find out who is *trying* to connect before accepting the
connection. I don't know the 'why' of this.

Paul T.
 
Back
Top