none
Maximum throughput of TCPListener RRS feed

  • Question

  • What is the maximum throughput of TCPListener ? Can I have 10,000 client connections at a time and data being sent to clients at the rate of 100 KB/Sec to each client and receiving at the same rate from each? Is TCPListener still going to be efficient if horsepower of the server is not a problem ?

    Is that kind of load practical for TCPListener or we have to go back to the old school C++ sockets for that ?

    Thanks for your help in advance


    Fahad

    Wednesday, March 13, 2013 8:01 PM

Answers

  • I don't know the answer, but the performance of TCPListener should be approximately the same as C++ sockets.

    jdweng

    Thursday, March 14, 2013 11:47 AM
  • Hi Fahad349,

    For the TcpListener, it is just a well-encapsulated .NET socket server component for you to easily setup a socket server app. Unless you need more low leve control over the undelying socket object, using TcpListener will make things simpler than dealing with .NET Socket class (or even unmanaged socket API) directly. And for performance, there isn't obvious performance limit of TcpListener comparing to the Socket class (except the fact that since it is more encapsulated than raw Socket class, it will add a bit more overhead). and for the "Maximum throughput", there is no simple answer for this question. Because for the TcpListener (or even the .NET Socket class), there is no such designed limitations. The real limit (in production environment) totally depends on the hardware and network condition (such a CPU, memory, network bandwidth (local adpater and intermediate router, switch ....). And the same is for questions like "what is the maximum string length supported by .NET framework" or "what is the maximum number of Window I can create and display in .NET winform application", the API and classes themselves have no definite limit, but at runtime it will definitely hit a bottleneck depending on the hosting machine's system and hardware condition.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 28, 2013 2:56 AM
    Moderator

All replies

  • I don't know the answer, but the performance of TCPListener should be approximately the same as C++ sockets.

    jdweng

    Thursday, March 14, 2013 11:47 AM
  • Hi Fahad349,

    For the TcpListener, it is just a well-encapsulated .NET socket server component for you to easily setup a socket server app. Unless you need more low leve control over the undelying socket object, using TcpListener will make things simpler than dealing with .NET Socket class (or even unmanaged socket API) directly. And for performance, there isn't obvious performance limit of TcpListener comparing to the Socket class (except the fact that since it is more encapsulated than raw Socket class, it will add a bit more overhead). and for the "Maximum throughput", there is no simple answer for this question. Because for the TcpListener (or even the .NET Socket class), there is no such designed limitations. The real limit (in production environment) totally depends on the hardware and network condition (such a CPU, memory, network bandwidth (local adpater and intermediate router, switch ....). And the same is for questions like "what is the maximum string length supported by .NET framework" or "what is the maximum number of Window I can create and display in .NET winform application", the API and classes themselves have no definite limit, but at runtime it will definitely hit a bottleneck depending on the hosting machine's system and hardware condition.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 28, 2013 2:56 AM
    Moderator