Structure used with the PR_SockOpt_Linger socket option to specify the time interval (in PRIntervalTime units) to linger on closing a socket if any data remain in the socket send buffer.

Syntax

#include <prio.h>

typedef struct PRLinger {
  PRBool polarity;
  PRIntervalTime linger;
} PRLinger;

Fields

The structure has the following fields:

polarity
Polarity of the option's setting: PR_FALSE means the option is off, in which case the value of linger is ignored. PR_TRUE means the option is on, and the value of linger will be used to determine how long PR_Close waits before returning.
linger
Time (in PRIntervalTime units) to linger before closing if any data remain in the socket send buffer.

Description

By default, PR_Close returns immediately, but if there are any data remaining in the socket send buffer, the system attempts to deliver the data to the peer. The PR_SockOpt_Linger socket option, with a value represented by a structure of type PRLinger, makes it possible to change this default as follows: