Instable TCP Socket

I am opening a TCP socket and sending some datas to my server.

After some time, like 3 or 4 transmitions…I got the following error:

After this, I am turning on a timer that tries to re-connect but the followig error occurs:

Any one knows how to re-connect with success ???

Gustavo Nunes

Are you sure your first data arrived at your server?

Sounds like your TCP socket opens, but fails to receive data. You then only receive your first TCP time-out reponse after you have transmitted 3 or 4 times.

Yeah…Sometimes my connection is good and I receive a lot of datas, but then it stops and this error occurs.

Usually, I receive some bytes…than the server stops to receive and after that my Wavecom module return the error.

I detected the same problem, but i don’t know where come from.
For me when i want to send data to server i open the socket, i send data, and close the socket.
And after in certain case when i try to open a new socket i also receive the
For these problem i have received a wavecom response :

[b]The -34 (ED_ERR_DISTANT_OPEN) is encountered in the following conditions:

  1.    The error -34 (ED_ERR_DISTANT_OPEN) can be received when the received signal strength is weak. This problem occurs when the modem is in an area of weak signal strength, such as in roaming etc. The received signal strength can be checked by executing the command “AT+CSQ”.

If the “AT+CSQ” command returns ‘99’, it means that the network is not detectable.
2. This error can also be received in case the TCP sequence numbers become invalid. In such case, the TCP server sends the correct sequence
number to the TCP client. If the client is not able to synchronize it after a number of repeated attempts by the server, the listening server closes
and receives ED_ERR_DISTANT_OPEN. The client entity receives ED_ERR_DISTANT_TCP_CLOSED_BY_PEER event and the socket gets closed.
When a TCP socket is closed on receiving -34 error, the socket needs to be created afresh. To solve the -34 error from an Open AT application, a check can
be applied on “AT+CREG=1” command responses. The syntax for the command is:
If the “AT+CREG=1” command returns unsolicited response “+CREG: 1, 2”, it means the ME is searching for the network. In such case, the application
should wait for the module to get attached to the network (“+CREG: 1, 1”) and try to establish the TCP socket again from within the application. As soon
as the module gets attached to the network, the module will try to reestablish the TCP socket.

BUT in my case that didn’t solve my problem so when i detect 3 times consecutively these error i close my session IP and i re-open a new session (i retreive a new fresh IP adress) and it look working.

Just a question when you have these problem do you think you have move and change of BTS ?

Hi, I´ve been through the same problem as you guys…

But… ocean, how are you making a new connection?

Can you help me? Here´s how I´m doing:

After getting the “DIST_OPEN” I call the functions:
adl_gprsUnsubscribe(gprsHandler); and then ed_DialupConnectionStop(disconnectHandler);

When I receive the event “ED_OK_HOOK” from the “disconnectHandler” I try the function: adl_gprsSubscribe(gprsHandler);
That´s when I receive: ADL_GPRS_EVENT_DEACTIVATE_OK event.
And it doesn´t work.

Any ideas?