SocketOptionOps

gears.async.io.SocketOptionOps
trait SocketOptionOps extends Handles

The socket options ops, for a backend with sockets: what it supports, for each kind of socket, and reading and changing them on an open socket. Plain methods, not ops: every backend answers at once.

Attributes

Graph
Supertypes
trait Handles
trait Interface
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Inherited and Abstract types

type Handle <: AnyRef

Names an open file, socket, or other I/O object of the backend: an object of the backend's own class, which only the backend can make, so that a program cannot forge a handle, nor pass one backend's handle to another, whose Handle is a different type. A program gets one from an op that opened something, and closes it with close; the backend never closes it.

Names an open file, socket, or other I/O object of the backend: an object of the backend's own class, which only the backend can make, so that a program cannot forge a handle, nor pass one backend's handle to another, whose Handle is a different type. A program gets one from an op that opened something, and closes it with close; the backend never closes it.

Attributes

Inherited from:
Handles
type Op

What these ops are built as, and a backend performs: a type of the backend's own, so that ops of another backend are a different type.

What these ops are built as, and a backend performs: a type of the backend's own, so that ops of another backend are a different type.

Attributes

Inherited from:
Interface

Value members

Abstract methods

def canChange(option: SocketOption[_], kind: Kind): Boolean

Whether option can be changed on an open socket of kind kind (setOption) rather than only given as it opens: never ReusePort, which must be set before the socket binds.

Whether option can be changed on an open socket of kind kind (setOption) rather than only given as it opens: never ReusePort, which must be set before the socket binds.

Attributes

def option[V](handle: Handle, option: SocketOption[V]): V

option's value on the open socket handle, as the system has it: a buffer's size as the system gave it. Fails with an IllegalArgumentException for an option the backend does not support or that does not apply to the socket, and an IOException on a closed handle.

option's value on the open socket handle, as the system has it: a buffer's size as the system gave it. Fails with an IllegalArgumentException for an option the backend does not support or that does not apply to the socket, and an IOException on a closed handle.

Attributes

def setOption[V](handle: Handle, option: SocketOption[V], value: V): Unit

Sets option to value on the open socket handle, failing as option does, and with an IllegalArgumentException for one it cannot change (canChange).

Sets option to value on the open socket handle, failing as option does, and with an IllegalArgumentException for one it cannot change (canChange).

Attributes

def supports(option: SocketOption[_], kind: Kind): Boolean

Whether this backend, on this host, has option for sockets of kind kind: whether an opener of one given it applies it rather than failing. False for an option that does not apply to the kind (SocketOption.appliesTo).

Whether this backend, on this host, has option for sockets of kind kind: whether an opener of one given it applies it rather than failing. False for an option that does not apply to the kind (SocketOption.appliesTo).

Attributes

Inherited methods

final def timer(milliseconds: Long): Op & Repeatable

Completes once milliseconds have passed (see the other timer): not negative, and no more than a FiniteDuration holds, Interface.MaxTimerMillis, some 292 years, else an IllegalArgumentException as the op is built.

Completes once milliseconds have passed (see the other timer): not negative, and no more than a FiniteDuration holds, Interface.MaxTimerMillis, some 292 years, else an IllegalArgumentException as the op is built.

Attributes

Inherited from:
Interface

Inherited and Abstract methods

def close(handle: Handle): Op

Closes handle, completing once it is closed. The ops under way on it, from whichever future, have failed with an IOException, a closed channel's (java.nio.channels.ClosedChannelException on the JVM and Scala Native, naming the handle), before this completes, as the JDK fails a thread blocked on a channel that is closed: none of them can succeed once the close has begun, and a perform waiting on one in another future throws once that future runs again, perhaps after the close's perform returns. Its number is then free for reuse, and a listener's port for listening on again. A Unix socket path that a listener or datagram socket bound is removed with it, if the file there is still its own, not one a later listener bound in its place: checked, then removed, as no system call removes a file only if it is a given one, so a listener binding the path between the two, a few microseconds, loses its file. Fails if handle is not open, with the failure an op submitted on a closed handle has: a closed channel's, as above.

Closes handle, completing once it is closed. The ops under way on it, from whichever future, have failed with an IOException, a closed channel's (java.nio.channels.ClosedChannelException on the JVM and Scala Native, naming the handle), before this completes, as the JDK fails a thread blocked on a channel that is closed: none of them can succeed once the close has begun, and a perform waiting on one in another future throws once that future runs again, perhaps after the close's perform returns. Its number is then free for reuse, and a listener's port for listening on again. A Unix socket path that a listener or datagram socket bound is removed with it, if the file there is still its own, not one a later listener bound in its place: checked, then removed, as no system call removes a file only if it is a given one, so a listener binding the path between the two, a few microseconds, loses its file. Fails if handle is not open, with the failure an op submitted on a closed handle has: a closed channel's, as above.

Attributes

Inherited from:
Handles
def deadlineTimer(nanoTime: Long): Op & Repeatable & Deadline

A timer that completes at nanoTime, on System.nanoTime's clock, a deadline that may be moved while it is pending (Deadline.moveTo), from any thread, so that a timer re-armed again and again, as QUIC's loss and pacing timers are for almost every packet, is one op performed once rather than one cancelled and performed anew each time. Performed again, it completes at its deadline as it stands then, at once if that has passed. Its time limit is as timer's.

A timer that completes at nanoTime, on System.nanoTime's clock, a deadline that may be moved while it is pending (Deadline.moveTo), from any thread, so that a timer re-armed again and again, as QUIC's loss and pacing timers are for almost every packet, is one op performed once rather than one cancelled and performed anew each time. Performed again, it completes at its deadline as it stands then, at once if that has passed. Its time limit is as timer's.

Attributes

Inherited from:
Interface
def timer(duration: FiniteDuration): Op & Repeatable

Completes once duration has passed since each submission, never before: to the nanosecond the backend can wait, which on kqueue is what kevent takes, and on NIO the millisecond its selector waits in. A time limit on its submission shorter than duration fails it with TimeoutException when the limit comes, as any op's does; one no shorter leaves it to complete. Not negative.

Completes once duration has passed since each submission, never before: to the nanosecond the backend can wait, which on kqueue is what kevent takes, and on NIO the millisecond its selector waits in. A time limit on its submission shorter than duration fails it with TimeoutException when the limit comes, as any op's does; one no shorter leaves it to complete. Not negative.

Attributes

Inherited from:
Interface