Pike v8.0 release 1738

Method Stdio.Fd()->linger()


Method linger

bool linger(int(-1..65535)|void seconds)

Description

Set the socket linger behaviour on close().

Parameter seconds
-1

Reset to default behaviour. This typically means that close() will return immediately, but any buffered data will still be sent if possible.

0

Terminate the connection immediately on close(), and discard any buffered data.

(1..65535)

Have close() wait for at most seconds seconds for any buffered data to be sent after which the connection is terminated.

Returns

Returns 1 on success, and 0 (zero) on failure.

Note

This operation is only valid on sockets.

Note

This function was not available in Pike 7.8.775 and earlier.

See also

close()