IBM Support

Terminating Non Blocking connect()

Troubleshooting


Problem

Application closes Non Blocking socket before connect completes (socket writable) but netstat conn command shows connection in syn_sent state.

Cause

The application that issued the Non Blocking connect determines that it should be abandoned either because a select () timer expires or timer internal to the application expires. The application then issues a close() on this socket which results in a FIN packet that is queued on connection until a 3 minute, internally hardcoded, connection establishment timer expires. During this 3 minute window the TCP layer continues to retransmit the original SYN packet from the connect() that was abandoned.

Resolving The Problem

Before issuing the close(), the application should set the so_linger option on with a linger time value of zero by way of the setsockopt() function. This will cause a reset packet to be generated and the connection immediately aborted with no further SYN retransmissions.

[{"Product":{"code":"SSSN3L","label":"z\/OS Communications Server"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"All","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"1.13;2.1;2.2;2.3","Edition":"Enterprise","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
15 June 2018

UID

swg21220159