views:

1185

answers:

2

I don't see much use of TCPClient, yet there is a lot of Socket? What is the major difference between them and when would you use each?

I understand that .net socket are written on top of WINSOCK, and TCPClient is a wrapper over Socket class. Thus TCPClient is way up the chain, and possibly inefficient. Correct me if I am wrong.

Thanks

+7  A: 

The use of TcpClient and TcpListener just means a few less lines of code. As you say it's just a wrapper over the Socket class so there is no performance difference between them it's purely a style choice.

sipwiz
+1  A: 

Also, you can access the socket directly from the TCPClient object, it's under the property Client - so there is no performance difference.

John Rasch