NetCoreServer icon indicating copy to clipboard operation
NetCoreServer copied to clipboard

Getting IP address of newly connected client

Open furkangkhsn opened this issue 1 year ago • 1 comments

If i try to access this.Socket from the constructor of TcpSession, it returns null. How can i access to client's ip address from constructor?

furkangkhsn avatar Jul 31 '22 16:07 furkangkhsn

It is designed that this.Socket is initialized in TcpSession.Connect(Socket socket). In your code you can override OnConnecting() or OnConnected() and access initialized and valid this.Socket property.

chronoxor avatar Aug 01 '22 20:08 chronoxor

Thank you.

furkangkhsn avatar Aug 15 '22 12:08 furkangkhsn