Lisp HUG Maillist Archive

Tcp socket hangs after some inaction time

Hi list,

I'm coding a client in LWW 5.1.2 that communicates with a server written in erlang.
The exchanges seems to be ok when the communication is continuous.
However if there is no communication between the client & the server for a long period of time (I am 
not able to determine it precisely but it's something in the range 15 to 30 minutes) then the socket 
hangs in one way meaning that the server is no more capable of pushing data to the client.

What I see :

- The erlang server is not blocked at this state as I am able to continue using it with another 
client : it is pushing data into the socket TCP buffer until it's filled and then it blocks (seems 
ok to me)

- The socket is still alive

- When the client writes something new onto the socket, then the socket is "unfrozen" after a few 
seconds (20) and the client gets the data that was waiting in the server's buffer.

What could cause this ?
Does I need to code some ping-pong exchange to maintain the socket active ?

Thanks,

Sébastien Saint-Sevin


Re: Tcp socket hangs after some inaction time

I've noticed something similar, although I haven't got around to
investigating it seriously (as it doesn't seem very repeatable). I'm
using LWW 5.1.2 for my server and LWW 5.1.2 and the Flash Player for
my clients, but the symptoms are similar; the link works fine, then
after a period of inactivity, data written at one end is not received
at the other. Sorry I can't be more specific.

I had more or less resigned myself to implementing a "ping/ack" kind
of thing, if only to gather some data on the issue.

Cheers,

John :^P

On Fri, Sep 4, 2009 at 5:47 PM, Sebastien
Saint-Sevin<s.saint.sevin@xehex.com> wrote:
>
> Hi list,
>
> I'm coding a client in LWW 5.1.2 that communicates with a server written in
> erlang.
> The exchanges seems to be ok when the communication is continuous.
> However if there is no communication between the client & the server for a
> long period of time (I am not able to determine it precisely but it's
> something in the range 15 to 30 minutes) then the socket hangs in one way
> meaning that the server is no more capable of pushing data to the client.
>
> What I see :
>
> - The erlang server is not blocked at this state as I am able to continue
> using it with another client : it is pushing data into the socket TCP buffer
> until it's filled and then it blocks (seems ok to me)
>
> - The socket is still alive
>
> - When the client writes something new onto the socket, then the socket is
> "unfrozen" after a few seconds (20) and the client gets the data that was
> waiting in the server's buffer.
>
> What could cause this ?
> Does I need to code some ping-pong exchange to maintain the socket active ?
>
> Thanks,
>
> Sébastien Saint-Sevin
>
>


Re: Tcp socket hangs after some inaction time


On 4 Sep 2009, at 17:47, Sebastien Saint-Sevin wrote:

> I'm coding a client in LWW 5.1.2 that communicates with a server  
> written in erlang.
> The exchanges seems to be ok when the communication is continuous.
> However if there is no communication between the client & the server  
> for a long period of time (I am not able to determine it precisely  
> but it's something in the range 15 to 30 minutes) then the socket  
> hangs in one way meaning that the server is no more capable of  
> pushing data to the client.

Do you have any non-trivial network between the two systems - anything  
more than a switch?  Things like firewalls and anything doing NAT have  
to maintain state per-connection, and (since they can't reliably know  
when a connection has gone away) they will garbage-collect this state  
for connections which have had no traffic for a long time.  This can  
produce exactly this kind of symptom.

This probably does not (or should not) include host-based firewalls  
etc, as they should be able to know whether the socket is still alive  
by introspection.


Updated at: 2020-12-10 08:40 UTC