From: Per W. <pw...@ia...> - 2003-10-21 23:14:08
|
This is a normal behaviour. The TCP stack has a timeout time how long it should block a socket from being reused. If you do int i = 1; setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char*)&i,sizeof(i)); you tell the stack that you don't want this behaviour. Then you don't have to wait 90 seconds or whatever default value the stack is using. /Per W > hi, > I tried to connect one client program in one linux machine to communicate > another server > program in another machine using sockets. > When once i use one port,if i try to use the same port again..It is saying > that connection refused. > When i give netstat command,it is showing all these ports in CLOSE_WAIT > state.. > What should i do to use the same port after i close the socket in my > program.. > Can anybody help me... > All earlier help from this group help me lot to go forward... > Forgive me for my bad english.. > regds > smitha > > > > > ------------------------------------------------------- > This SF.net email is sponsored by OSDN developer relations > Here's your chance to show off your extensive product knowledge > We want to know what you know. Tell us and you have a chance to win $100 > http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |