Linger Property

When set to True, connections are terminated gracefully.

Object Oriented Interface

public function getLinger();
public function setLinger($value);

Procedural Interface

ipworksssh_sshtunnel_get($res, 29 );
ipworksssh_sshtunnel_set($res, 29, $value );

Default Value

true

Remarks

This property controls how a connection is closed. The default is True. In this case the connection is closed only after all the data is sent. Setting it to False forces an abrupt (hard) disconnection. Any data that was in the sending queue may be lost.

The default behavior (which is also the default mode for stream sockets) might result in an indefinite delay in closing the connection. Although the class returns control immediately, the system might indefinitely hold system resources until all pending data is sent (even after your application closes). This means that valuable system resources might be wasted.

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you have sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

This property is shared among incoming connections. When the property is set, the corresponding value is set for incoming connections as they are accepted. Existing connections are not modified.

Data Type

Boolean

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 PHP Edition - Version 20.0 [Build 8501]