When set to True, connections are terminated gracefully.
ANSI (Cross Platform) int GetLinger();
int SetLinger(int bLinger); Unicode (Windows) BOOL GetLinger();
INT SetLinger(BOOL bLinger);
@property (nonatomic,readwrite,assign,getter=linger,setter=setLinger:) BOOL linger; - (BOOL)linger; - (void)setLinger:(BOOL)newLinger;
#define PID_TELNET_LINGER 16 IPWORKS_EXTERNAL void* IPWORKS_CALL IPWorks_Telnet_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal); IPWORKS_EXTERNAL int IPWORKS_CALL IPWorks_Telnet_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);
This property controls how a connection is closed. The default is True.
In the case that Linger is True (default), there are two scenarios for determining how long the connection will linger. The first, if LingerTime is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.
In the second scenario, LingerTime is a positive value, the system will attempt to send pending data until the specified LingerTime is reached. If this attempt fails, then the system will reset the connection.
The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the class returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).
Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.