Need some urgent help, please!!

  • Thread starter Thread starter Tom Rahav
  • Start date Start date
T

Tom Rahav

Hello All!

I need to extract Socket object from a TcpClient object, in order to get
client's IP address.
I've found the following article that describes how to derive from TcpClient
class and use the Client property (that I need so much...!).
http://msdn.microsoft.com/library/d...systemnetsocketstcpclientclassclienttopic.asp
I created such class (as described) but I failed to use it...
My current code is:

oTcpClient = oTcpListener.AcceptTcpClient();

I tried to cast the oTcpClient to the new derived class (named
clsAdvancedTCPClient), but I got an error: "This cast is not valid"
Can someone explain me please how can I get the requested Client property
from the TcpClient object?

Thanks in advanced!
Tom Rahav.
 
I get ur point.
Actually tcplistner.AcceptTcpClient() return TcpClient object rather than ur
derived class object.
I assume even as operator wont work for u
try using AcceptSocket() method.
 
Back
Top