TCPClient vs Socket in C#

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.

Update: Since this answer was posted the .Net source code has become available. It does indeed show that TcpClient is a very light wrapper over the Socket class which is itself a wrapper on top of the native WinSock2 API*.

  • On Windows. Will be different for .Net Standard/Core etc. on other platforms.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)