Linger.this

If timeout is 0, linger is disabled, otherwise enables the linger and sets the timeout.

  1. this(ushort timeout)
    struct Linger
    this
    (
    const ushort timeout
    )
  2. this(LingerField l_onoff, LingerField l_linger)

Parameters

timeout ushort

Timeout, in seconds.

Examples

{
    auto linger = Linger(5);
    assert(linger.enabled);
    assert(linger.time == 5);
}
{
    auto linger = Linger(0);
    assert(!linger.enabled);
}
{ // Default constructor.
    Linger linger;
    assert(!linger.enabled);
}

Meta