How to get TCPClient's IP from TCPListener

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zZ

    How to get TCPClient's IP from TCPListener

    Hi All,

    I'm building a TCPListener as the server to accept TCPClient connections,
    using

    TCPListener.Acc eptTcpClient.

    I'd like to retrieve client's IP after connected, but found no way to do so.
    Is there a walkaround? Thanks for any tip.


    Kind regards,
    Zen


  • Bill

    #2
    Re: How to get TCPClient's IP from TCPListener

    TCPClient tc = TCPListener.Acc eptTcpClient();
    Socket s = tc.Client;
    Console.WriteLi ne("I am connected to " +
    IPAddress.Parse (((IPEndPoint)s .RemoteEndPoint ).Address.ToStr ing()) +
    "on port number " + ((IPEndPoint)s. RemoteEndPoint) .Port.ToString( ));




    socket.RemoteEn dPoint
    "zZ" <zzhang@student en.net> wrote in message
    news:3f8d8741_4 @newsreader.con cepts.nl...[color=blue]
    > Hi All,
    >
    > I'm building a TCPListener as the server to accept TCPClient connections,
    > using
    >
    > TCPListener.Acc eptTcpClient.
    >
    > I'd like to retrieve client's IP after connected, but found no way to do[/color]
    so.[color=blue]
    > Is there a walkaround? Thanks for any tip.
    >
    >
    > Kind regards,
    > Zen
    >
    >[/color]


    Comment

    Working...