TIME_WAIT after socket is closed?
Posted on 2002-04-09
I have a server and client socket program written under Visual C++ 5.0.
After sending data, I successfully closed client's socket and server's socket by using <closesocket> function provided by <winsock2.h>.
But when I netstat -a under windows platform. I can see some of the port that previously been established showing "TIME_WAIT". It this cause by my program???
If it is cause by my program, how come only some of the port is "PENDING" there. Because I tried to do a loop that open, send data, and close 30 socket in a time. Only 5 socket show "TIME_WAIT". After certain time, I netstat again the "TIME_WAIT" disappear.
Guys, any idea?