Hello.
As far as I understood , the GSM network automatically close a TCP connection if there is not any traffic on it for some time.
The connection procedure is as follows: my GSM module acts as a server, so it opens a socket on port 502 and wait for clients to read data. The client can read data periodically at 3 minutes or longer.
The question is: how to interpret this "re-establishment" of the connection?
1. Should I close the current TCP connection, and open a new one, meaning listening to port 502 again?
2. Should I close the current TCP connection and trying to connect to the port and ip of the client as provided from the last valid TCP connection?
The point is that the module must be available as soon as possible to answer to client's requests; that it is why I need the TCP connection to be functional as soon as possible.
PS. The module supports just AT commands ( Quectel M95 module) so I don't have access to all functionalities of the TCP stack.
Thank you.
(I am new in TCP stack so I may have used technical terms with improper meaning)
I am working to a project involving a GSM/GPRS module which role it is to connect clients with some devices over the internet using TCP-IP and Modbus protocol. Now I am studying the TCP connecting scheme.As far as I understood , the GSM network automatically close a TCP connection if there is not any traffic on it for some time.
I want to detect and maintain TCP connection as reliable as possible. Also to detect half-open connections.The connection procedure is as follows: my GSM module acts as a server, so it opens a socket on port 502 and wait for clients to read data. The client can read data periodically at 3 minutes or longer.
When a client connects with my module , it requests for some data, the module sends the requested data and wait for other requests, and keeps the connection open. Now if the connection gets broken for other reasons (due to power failures, GSM network etc) the client needs to be able to connect with the module again. The module must detect broken connection and must act so the client can reconnect to it again
In order to detect broken connection the module send periodically some dummy data to the client and check if that data was received by the client. If not, the tcp connection must be re-established.The question is: how to interpret this "re-establishment" of the connection?
1. Should I close the current TCP connection, and open a new one, meaning listening to port 502 again?
2. Should I close the current TCP connection and trying to connect to the port and ip of the client as provided from the last valid TCP connection?
The point is that the module must be available as soon as possible to answer to client's requests; that it is why I need the TCP connection to be functional as soon as possible.
PS. The module supports just AT commands ( Quectel M95 module) so I don't have access to all functionalities of the TCP stack.
Thank you.
(I am new in TCP stack so I may have used technical terms with improper meaning)