Wireshark-users: Re: [Wireshark-users] TCP connection is still in ESTABLISH state actually it is
From: Andrew Hood <ajhood@xxxxxxxxx>
Date: Tue, 01 Jun 2010 08:43:10 +1000
Bo Xu wrote:
> Hello Andew ,
> 
>    There is firewall in the whole path .
> 
>     I have captured the packets about 3 hours , the file size is 24 , but
> after i download it ,there is not any packets.
> 
>    -rw-r--r--    1 root     system           24 May 31 19:34 65274.pcap
> 
>    So if i want to fix this issue , i have to change my application code
> slightly ?

Yes. You will have to add a setsockopt() call after opening the socket
to set SO_KEEPALIVE. This was written on Linux. I don't have a p-Series
at home.

int tcp_socket;
int keepalive=1;
int rc;
tcp_socket = socket(AF_INET, SOCK_STREAM, 0);
rc=setsockopt(tcp_socket, SOL_SOCKET, SO_KEEPALIVE, &keepalive,
sizeof(int));

-- 
There's no point in being grown up if you can't be childish sometimes.
                -- Dr. Who