Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum TCP client connection number on Windows 7 Pro for a C# TCP server software

i am running a TCP server on my machine. My operating sytem is Windows 7 Professional. I tested my server with a TCP connection test software and i think my computer does not allow more than 300-400 connections. I tested my software for 1000 TCP clients and everytime my software (or computer i don't know) does not accept more than 300-400 connections.

What is the maximum number of connections for a PC (not a server PC) practically not theoretically. I am developing software on a Windows 7 PC but i will use the software on a Windows Server so i want to know if the problem is my operating system or my software.

Thank you.

like image 298
sanchop22 Avatar asked Apr 12 '12 08:04

sanchop22


People also ask

How many TCP connections can a client handle?

On the TCP level the tuple (source ip, source port, destination ip, destination port) must be unique for each simultaneous connection. That means a single client cannot open more than 65535 simultaneous connections to a single server. But a server can (theoretically) serve 65535 simultaneous connections per client.

What is the maximum number of ports for a TCP connection?

The highest TCP port number is 65,535. The TCP protocol provides 16 bits for the port number, and this is interpreted as an unsigned integer; all values are valid, apart from 0, and so the largest port number is (2^16 - 1) or 65,535.

How many TCP connections can Windows handle?

Increasing the number of available (ephemeral) ports. By default, Windows only allocates ephemeral ports in the range 1024 through 4999. To increase the upper range of ephemeral ports that are dynamically allocated to client TCP/IP socket connections perform the following.

How many TCP connections is normal?

Microsoft limits the number of connections to 3975 by default, meaning that there can only be 3975 TCP/IP connections open at any given time. In addition, the TIME_WAIT state is configured by default to be 240 seconds. This means that Windows can only support an average of 33 TCP/IP connections per second.


2 Answers

The issue seems to be related to the number of ports that can be opened. The defaults are pretty less. Check this link to get steps on increasing them on windows

The max I believe is 65534

like image 87
Raam Avatar answered Oct 05 '22 22:10

Raam


I remember that there is a setting to limit the number of connections to a TCP port to avoid DoS attacks (Denial Of Service).

This is a setting that can be deactivated, maybe this is the limit you're reaching.

Look here

like image 33
Ignacio Soler Garcia Avatar answered Oct 05 '22 23:10

Ignacio Soler Garcia