Signalr 1.1.3 - IIS 7.5 - ports time_wait - iis

Is it possibile that a signalR hub opens lots of port on iis to handle connections with his clients?
Is it possible that this produce lots of TIME_WAIT (zombie connections?)?
IIS 7.5, it means that webSockets isn't supported.

through a tcp viewer i saw that signalr create 4/5 connections for each user on different port:
OnConnected;
When the client closes the connection (browser was closed or an exception was occurred) the state of connection changes in TIME_WAIT:
OnDisconnected;
After X seconds of TIME_WAIT all connections are deleted.

Related

UDP connections from website

Is there any way to start a UDP connection from within a website?
So that users can connect to a server listening for UDP packets while being on my website?
If you have full control over the server and the web application running on the server it can be done. If you don't have such control firewall settings or other kind of restrictions you don't control might limit what you can do.

Linux tcp half open socket

I have an application server which is listening for Tcp connection. The clients connecting to this application establish persistent connection with Tcp keepalive. Once in a while I would see that the client finds it has lost connection but the application server isn't aware of it.
I did see high cpu on application server once but I am not sure if it is correlated. Also there was no issue with the network.
Can this be because application server didn't reply to tcp keepalive probes and hence client disconnected?

SO_REUSEADDR Cause Server To Reuse TIME_WAIT Connection?

As far as I know, SO_REUSEADDR allows the server to bind to an address which is in a TIME_WAIT state. But how does it effect the action of server when accepting new connection?
Suppose we are communicating between host A and server B whose listen socket is setup with SO_REUSEADDR enabled, and there is a connection C1=(A, PortA, B, ListenPort) which is now in TIME_WAIT state (from Server B's Perspective).
Now if host A tries using the same pair (A, PortA) to connect to B, will the duplicate connection C2=(A, PortA, B, ListenPort) be established even when C1 is still in TIME_WAIT? Why?
The connection attempt (SYN) will be delivered to the connection in TIME_WAIT state, which will cause it to issue an RST, which will result in the client incurring a connection refusal.
If both the server socket and the client socket are using SO_REUSEADDR, both sides will be able to bind to the same port they were using before and the client will be able to establish a connection to the server.
I verified this between two local sockets on a RedHat 5 server with kernel 2.6.18.

linux doesn't detect dead tcp connections

After restarting my server side application, my client side OS doesn't detect dead tcp connections. The zombie connections will stay in established state, and never be closed by OS. Is anyone hava any idea about this?
This is the server side connections on port 9888:
This is the client side connections to the server:
Some information of my OS:
You might want to use TCP keep alive mechanism to detect the dead peers. As rightly mentioned in the comments you need to call set following socket options using setsockopt function,
SO_KEEPALIVE - To enable/disable the TCP keep alive mechanism
TCP_KEEPIDLE - IDLE time (in seconds) after which TCP starts sending keepalive probes
TCP_KEEPCNT - Maximum number of keepalive probes TCP should send before dropping the connection
TCP_KEEPINTVL - The time (in seconds) between individual keepalive probes
So for example if you set ideal time = 60 seconds, cnt = 5 and interval = 2 seconds, the system will drop the connection after 70 seconds of inactivity.
More details are available at following website
http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html
Hope this helps.

How to handle TCP long connection when one server fail?

I have many linux servers (cluster) to run my application.The application use C/S structure,client connect to server using TCP long connection(server is basing apache mina socket framework).
my question is : When one server shutdown, how other servers can keep the socket connection established between the failure server and the clients?
so the server-down failure can be transparent to clients and clients need not reconnect to server.
Thanks
L.J.W
You cannot simply migrate a TCP connection unless there is some kind of never-failing proxy in between like a layer-4-switch.

Resources