Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
Stdio
Stdio.File

Method Stdio.File()->linger()


Method linger

int(0..1) 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()