tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Connection not Closed at TCP level
Date Wed, 07 Aug 2013 10:54:54 GMT
Hi,


On Wed, Aug 7, 2013 at 12:12 PM, hidayath <hidayath.basha@saventech.com>wrote:

> Hi,
>
>
>
> We have a websocket application which keeps writing data to the clients.
>
>
>
> We found that when tabs (not whole browser) of Firefox (ver. 22) is closed,
> the websocket connection is not closed. Anyway, reproducibility is very
> low.
> And the sendQ (netstat -an) keeps growing
>
>
>
> So, what we did is. we kept sending heart beat from client. If this heart
> beat timeout occurs, we are trying to close the connection as follows
>
> ByteBuffer bbuff = ByteBuffer.allocate(1);
>
> bbuff.put((byte) 0);
>
> messageInbound.getWsOutbound().close(0, bbuff);
>
>
>
> Is this correct approach to close the connection from server? Because, the
>

You can also close the connection from the client with something like:

document.addEventListener('beforeunload', function() {ws.close();})


> connection is not closed at lower level (netstat -an). Anyway, writing data
> to it , is stopped and sendQ stops growing.
>
>
>
> # netstat -an | grep :8080
>
> tcp        0 402376 172.22.59.176:8080      198.162.18.207:64805
> ESTABLISHED
>
>
>
> Thanks and regards,
>
> Hidayath
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message