Linger.this - multiple declarations

Function Linger.this

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

this (
  const(ushort) timeout
);

Parameters

NameDescription
timeout Timeout, in seconds.

Example

{
    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);
}

Function Linger.this

System dependent constructor.

this (
  int l_onoff,
  int l_linger
);

Parameters

NameDescription
l_onoff l_onoff value.
l_linger l_linger value.

Example

auto linger = Linger(1, 5);
assert(linger.l_onoff == 1);
assert(linger.l_linger == 5);