socket accessor in vww7.4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

socket accessor in vww7.4

Suresh kumar

Hi,

 

My application is running in VW7.4 and we have a client which listens to 3002 port and reading the contents

 

The code is something like this.

 

3002Client >> startConnectionStream (here port is 3002)

 

                self connectionStream: (SocketAccessor newTCPclientToHost: self host port: self port asNumber timeout: 10000) readAppendStream.

                self connectionStream lineEndCRLF.

 

After some time (may be hours or days and the behavior is not consistent), connectionStream is getting terminated. And the output of netstat command shows the status of the port of CLOSE_WAIT.

I did some research in google and there are same issues with java socket and they are suggesting to user keepAlive. I don’t see keepAlive except in HttpClient. Please suggest  is there anything same mechanism here in SocketAccessor hierarchy.

 

Thanks,

Suresh


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: socket accessor in vww7.4

Boris Popov, DeepCove Labs (SNN)

Untested suggestion,

 

aSocketAccessor

                setOptionsLevel: SocketAccessor SOL_SOCKET

                name: SocketAccessor SO_KEEPALIVE

                value: 1

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ee470551(v=vs.85).aspx

 

When this socket option is enabled, the TCP stack sends keep-alive packets when no data or acknowledgement packets have been received for the connection within an interval. For more information on the keep-alive option, see section 4.2.3.6 on the Requirements for Internet Hosts—Communication Layers specified in RFC 1122 available at the IETF website. (This resource may only be available in English.)

 

The SO_KEEPALIVE socket option is valid only for protocols that support the notion of keep-alive (connection-oriented protocols). For TCP, the default keep-alive timeout is 2 hours and the keep-alive interval is 1 second. The default number of keep-alive probes varies based on the version of Windows.

 

-Boris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Suresh Kumar
Sent: Monday, July 29, 2013 5:35 PM
To: [hidden email]
Subject: [vwnc] socket accessor in vww7.4

 

Hi,

 

My application is running in VW7.4 and we have a client which listens to 3002 port and reading the contents

 

The code is something like this.

 

3002Client >> startConnectionStream (here port is 3002)

 

                self connectionStream: (SocketAccessor newTCPclientToHost: self host port: self port asNumber timeout: 10000) readAppendStream.

                self connectionStream lineEndCRLF.

 

After some time (may be hours or days and the behavior is not consistent), connectionStream is getting terminated. And the output of netstat command shows the status of the port of CLOSE_WAIT.

I did some research in google and there are same issues with java socket and they are suggesting to user keepAlive. I don’t see keepAlive except in HttpClient. Please suggest  is there anything same mechanism here in SocketAccessor hierarchy.

 

Thanks,

Suresh


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: socket accessor in vww7.4

Reinout Heeck-2
On 7/29/2013 7:48 PM, Boris Popov, DeepCove Labs wrote:

Untested suggestion,

 

aSocketAccessor

                setOptionsLevel: SocketAccessor SOL_SOCKET

                name: SocketAccessor SO_KEEPALIVE

                value: 1


With this solution the interval between the keep-alive packets cannot be controlled. These packets may have hours between them while we found that several firewalls are configured to drop connection data within fifteen minutes of non-activity. (Such firewall behavior is equivalent to net-split).


So we use another strategy (this one IS tested ;-)

In our communication protocols we add in a 'no-operation' message that we can send both directions without expecting a response. On both ends of the connection we implement a loop that inserts such a message every minute or so.
This serves two purposes:
-- firewalls with a no-activity timeout rule see activity so they do not drop the connection's data
-- both sides of the connection can detect net-split (which raises an OsError)

Detecting net-split in a TCP session can only be done by sending data, not while waiting passively.
This is the reason we need to implement this loop on both sides.



If you have no control over the design of the protocol you'll have to look for innocent messages that you can abuse for this purpose (such messages may return a response, it is not a requirement that they do not elicit a response).




HTH,

Reinout Heeck



 

http://msdn.microsoft.com/en-us/library/windows/desktop/ee470551(v=vs.85).aspx

 

When this socket option is enabled, the TCP stack sends keep-alive packets when no data or acknowledgement packets have been received for the connection within an interval. For more information on the keep-alive option, see section 4.2.3.6 on the Requirements for Internet Hosts—Communication Layers specified in RFC 1122 available at the IETF website. (This resource may only be available in English.)

 

The SO_KEEPALIVE socket option is valid only for protocols that support the notion of keep-alive (connection-oriented protocols). For TCP, the default keep-alive timeout is 2 hours and the keep-alive interval is 1 second. The default number of keep-alive probes varies based on the version of Windows.

 

-Boris

 

From: [hidden email] [[hidden email]] On Behalf Of Suresh Kumar
Sent: Monday, July 29, 2013 5:35 PM
To: [hidden email]
Subject: [vwnc] socket accessor in vww7.4

 

Hi,

 

My application is running in VW7.4 and we have a client which listens to 3002 port and reading the contents

 

The code is something like this.

 

3002Client >> startConnectionStream (here port is 3002)

 

                self connectionStream: (SocketAccessor newTCPclientToHost: self host port: self port asNumber timeout: 10000) readAppendStream.

                self connectionStream lineEndCRLF.

 

After some time (may be hours or days and the behavior is not consistent), connectionStream is getting terminated. And the output of netstat command shows the status of the port of CLOSE_WAIT.

I did some research in google and there are same issues with java socket and they are suggesting to user keepAlive. I don’t see keepAlive except in HttpClient. Please suggest  is there anything same mechanism here in SocketAccessor hierarchy.

 

Thanks,

Suresh



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc