> When a client calls the web method there is a
> socket in the server left in TIME_WAIT state.
 
That's perfectly normal.
The server remembers that there was a socket that was active but it now closed 
again in order that it can answer retransmission requests & avoid reusing the 
port so quickly it might confuse people.
This is normal and expected behaviour, and bad things can happen if this didn't 
occur (they're unlikely to happen, but...)
 
So, if you run your server for a bit, you end up with TIME_WAIT sockets 
building up.  So what?
Don't worry - the OS cleans them up.  You don't need to worry about them.
 
What can be a pain is if you close your server down and then attempt to restart 
it - if you've got TIME_WAIT sockets around, they'll prevent your server 
opening its listening socket by default.
 
So you may wish to set SO_REUSEADDR on the server's listening socket - that 
tells the server "it's ok if there are other sockets on this port" and it'll 
then let you open up a listening socket even if there are TIME_WAIT sockets 
hanging around.
It won't let you open up two TCP listening sockets on the same port though - 
that won't work (well, actually it won't let you open two TCP listening sockets 
on the same port on the same IP address - it's possible to listen on different 
IP addresses on the same port on a multi-homed host, but generally people just 
listen on "all" IP addresses owned by the host).

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed 
Scanning Services - powered by MessageLabs. For further information visit 
http://www.verizonbusiness.com/uk

<<winmail.dat>>

Reply via email to