Loosing TCP connection on some android devices

Posts: 1
Joined: Fri Aug 11, 2017 1:59 pm

Loosing TCP connection on some android devices

Postby cylinder » Fri Aug 11, 2017 2:37 pm

Im not sure that im posting this in the correct location of the forum, but here it goes.

I am havving issues maintaining a stable tcp connection between the ESP and an android phone. The strange thing is that i've tried the android application on a number of devices, and only one of them are failing so far, a Huawei P10 plus.

Connecting to the AP from the android devices are all good.

The ESP acts as a server. It gets a connection from the P10 plus and the P10 plus sends an array of bytes over TCP. Then the esp proccesess the information, and sends back an array of bytes as a response.
This scenario is then repeated until the client(android app) ends the connection.

Although this wont work with the P10 plus as a client. They connect fine and the initiall packets are beeing transmitted as expected but after around 20 sec it always fails. The ESP sends an RST packet and on the android side a SocketException "Software caused connection abort" are thrown on reading from the inputstream.

I've made a packet capture of this on the phone.

Any help would be greatly appreciated.
Getting an RST from the server(ESP8266)

Posts: 6
Joined: Wed Dec 09, 2020 4:15 pm

Re: Loosing TCP connection on some android devices

Postby Nielson » Mon Mar 08, 2021 7:17 pm

The conventional approach to this sort of issues is to implement an application-level protocol heartbeat. Say if there's no other gbwhatsapp application data to be sent over the connection send a heartbeat message after

Code: Select all

seconds of inactivity. This means the other side can assume the connection is dead after receiving no messages for longer then

Code: Select all


Posts: 4
Joined: Mon Apr 26, 2021 4:50 pm

Re: Loosing TCP connection on some android devices

Postby milesstone » Mon Apr 26, 2021 4:54 pm

Hello I am newbie here,

and thanks Nielson for sharing this info I am exactly having the same issue with TCP connection.

Check this new version of GBWhatsApp apk

Who is online

Users browsing this forum: No registered users and 7 guests