TCP/IP CLOSE_WAIT Problem

TCP/IP CLOSE_WAIT Problem SearchSearch
Author Message
muthu
New member
Username: Aasai78

Post Number: 3
Registered: 10-2006
Posted on Tuesday, October 31, 2006 - 04:30 am:   

Hi,
We can able to configure the NowSMS with SMPP Client using the GSM modem Successfully.
we are successfully sending and receiving messages, after some transactions the connection between the SMPP client and SMPP sever(NowSMS) goes to CLOSE_WAIT state. After this we are unable to send or receive messages. So we have to restart my SMPP Client always after the CLOSE_WAIT state.

Can you please suggest what might be the problem?.

Thanks.
aasai & vijay
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6751
Registered: 10-2002
Posted on Tuesday, October 31, 2006 - 07:17 pm:   

Hi aasai & vijay,

TCP CLOSE_WAIT problems are usually associated with extremely busy servers that open and close a lot of connections very quickly ... web servers in particular.

I could only see CLOSE_WAIT states being an issue with NowSMS and an SMPP client if your SMPP client always binds to the same source IP port number when it makes its connection. The TCP/IP protocol itself has a limitation that once a connection between a particular source IP/port and destination IP/port is terminated, a new connection cannot be initiated until a timeout period expires (I believe it is approximately 2 minutes).

The solution to the above issue is to have your client not bind to a specific source port ... the default behaviour is to use a dynamic source port, so you have to take special action to request a specific source port.

But something tells me that you aren't talking about any of this.

I'm just guessing, but are you trying to tell me that the server is periodically terminating your client's connection?

If so, of course, the obvious answer is to reconnect.

However, there is a less obvious answer that is preferred ... that is, to understand why the server would be terminating the SMPP client's connection. The reason is because an SMPP client needs to periodically send an "enquire link" message to the server to let the server know that the client is still alive. Otherwise, the server will terminate the connection to the client. We recommend that clients should do this at least every 60 seconds of inactivity. The default for NowSMS is that it will terminate a client if it is inactive without sending an enquire link for 120 seconds. This timeout can be changed or disabled with the following SMSGW.INI file parameter, under the [SMSGW] header:

SMPPServerEnquireLink=###

(v2006+) Specifies an enquire link (idle) timeout in seconds for the SMPP server. If the SMPP server does not receive an enquire link (or other command) within this timeout period, the connection will be automatically terminated. The default setting is 120 seconds. A value of 0 can be used to disable this timeout.

I'm just guessing, but I don't think this is a typical CLOSE_WAIT issue ... I think the server is terminating your connection because the client is not sending this enquire link.

-bn