Implementation of IConnection using a socket. Implements receiving data when readable and sending queued data when writable.
Base class for a connection adapter. By itself, does nothing.
Base class for connection-less socket protocols, i.e. those for which we must use sendto instead of connect/send. These generally correspond to stateless / datagram-based protocols, like UDP. This module's class hierarchy is mostly oriented towards stateful, stream-based protocols; to represent connectionless protocols, this class encapsulates a socket with a fixed destination (sendto) address, and optionally bound to a local address. Currently received packets' address is not exposed.
Separates reading and writing, e.g. for stdin/stdout.
A POSIX file stream. Allows adding a file (e.g. stdin/stdout) to the socket manager. Does not dup the given file descriptor, so "disconnecting" this connection will close it.
General methods for an asynchronous socket.
Adapter for connections with a line-based protocol. Splits data stream into delimiter-separated lines.
An asynchronous socket-based connection.
An asynchronous connection server for socket-based connections.
Implements a stream connection. Queued Data is allowed to be fragmented.
An asynchronous TCP connection.
An asynchronous TCP connection server.
Fires an event handler or disconnects connections after a period of inactivity.
An asynchronous UDP stream. UDP does not have connections, so this class encapsulates a socket with a fixed destination (sendto) address, and optionally bound to a local address. Currently received packets' address is not exposed.
Used to indicate the state of a connection throughout its lifecycle.
Classifies the cause of the disconnect. Can be used to decide e.g. when it makes sense to reconnect.
Register a function to be called when the event loop is idle, and would otherwise sleep.
Returns true if this is a connection state for which disconnecting is valid. Generally, applications should be aware of the life cycle of their sockets, so checking the state of a connection is unnecessary (and a code smell). However, unconditionally disconnecting some connected sockets can be useful when it needs to occur "out-of-bound" (not tied to the application normal life cycle), such as in response to a signal.
Schedule a function to run on the next event loop iteration. Can be used to queue logic to run once all current execution frames exit. Similar to e.g. process.nextTick in Node.
Unregister a function previously registered with addIdleHandler.
Common interface for connections and adapters.
The current monotonic time. Updated by the event loop whenever it is awoken.
libev-based event loop implementation.
select-based event loop implementation.
The default socket manager.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Asynchronous socket abstraction.