G
Guest
Hello, folks
I have an application with a TCPListener object in it. When a connection comes in, and I want to accept it, I want to know the IP address of the thing that just connected to me. I can call AcceptSocket, and then I have a new socket object, and then I can get the IP address from that
However, I would prefer to use a TcpClient object instead. In the .Net Compact framework, I can't access the Socket member of the TcpClient object, and I can't find any other method that can get the IP address of the remote endpoint for the TcpClient
It just seems like there ought to be a way. I know how to do it if I resign myself to using the Socket class instead of TcpClient, but I want to take advantage of TcpClient's easier use, if I can
What I would really like is to refuse to Accept connections from any except trusted IP addresses, but that seems impossible. It seems like I have to call AcceptSocket in order to create a Socket, which I can then use to call to get the remote endpoint, and then if I don't like them, I can close the socket.
I have an application with a TCPListener object in it. When a connection comes in, and I want to accept it, I want to know the IP address of the thing that just connected to me. I can call AcceptSocket, and then I have a new socket object, and then I can get the IP address from that
However, I would prefer to use a TcpClient object instead. In the .Net Compact framework, I can't access the Socket member of the TcpClient object, and I can't find any other method that can get the IP address of the remote endpoint for the TcpClient
It just seems like there ought to be a way. I know how to do it if I resign myself to using the Socket class instead of TcpClient, but I want to take advantage of TcpClient's easier use, if I can
What I would really like is to refuse to Accept connections from any except trusted IP addresses, but that seems impossible. It seems like I have to call AcceptSocket in order to create a Socket, which I can then use to call to get the remote endpoint, and then if I don't like them, I can close the socket.