package tcp
- Alphabetic
- By Inheritance
- tcp
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Socket
[F[_]] extends AnyRef
Provides the ability to read/write from a TCP socket in the effect
F.Provides the ability to read/write from a TCP socket in the effect
F.To construct a
Socket, use the methods in the fs2.io.tcp package object.
Value Members
-
def
client[F[_]](to: InetSocketAddress, reuseAddress: Boolean = true, sendBufferSize: Int = 256 * 1024, receiveBufferSize: Int = 256 * 1024, keepAlive: Boolean = false, noDelay: Boolean = false)(implicit AG: AsynchronousChannelGroup, F: Async[F]): Stream[F, Socket[F]]
Stream that connects to the specified server and emits a single socket, allowing reads/writes via operations on the socket.
Stream that connects to the specified server and emits a single socket, allowing reads/writes via operations on the socket. The socket is closed when the outer stream terminates.
- to
address of remote server
- reuseAddress
whether address may be reused (see
java.net.StandardSocketOptions.SO_REUSEADDR)- sendBufferSize
size of send buffer (see
java.net.StandardSocketOptions.SO_SNDBUF)- receiveBufferSize
size of receive buffer (see
java.net.StandardSocketOptions.SO_RCVBUF)- keepAlive
whether keep-alive on tcp is used (see
java.net.StandardSocketOptions.SO_KEEPALIVE)- noDelay
whether tcp no-delay flag is set (see
java.net.StandardSocketOptions.TCP_NODELAY)
-
def
server[F[_]](bind: InetSocketAddress, maxQueued: Int = 0, reuseAddress: Boolean = true, receiveBufferSize: Int = 256 * 1024)(implicit AG: AsynchronousChannelGroup, F: Async[F]): Stream[F, Stream[F, Socket[F]]]
Stream that binds to the specified address and provides a connection for, represented as a Socket, for each client that connects to the bound address.
Stream that binds to the specified address and provides a connection for, represented as a Socket, for each client that connects to the bound address.
Returns a stream of stream of sockets.
The outer stream scopes the lifetime of the server socket. When the outer stream terminates, all open connections will terminate as well. The outer stream emits an element (an inner stream) for each client connection.
Each inner stream represents an individual connection, and as such, is a stream that emits a single socket. Failures that occur in an inner stream do *NOT* cause the outer stream to fail.
- bind
address to accept connections from
- maxQueued
number of queued requests before they will become rejected by server (supply <= 0 for unbounded)
- reuseAddress
whether address may be reused (see
java.net.StandardSocketOptions.SO_REUSEADDR)- receiveBufferSize
size of receive buffer (see
java.net.StandardSocketOptions.SO_RCVBUF)
-
def
serverWithLocalAddress[F[_]](flatMap: InetSocketAddress, maxQueued: Int = 0, reuseAddress: Boolean = true, receiveBufferSize: Int = 256 * 1024)(implicit AG: AsynchronousChannelGroup, F: Async[F]): Stream[F, Either[InetSocketAddress, Stream[F, Socket[F]]]]
Like server but provides the
InetSocketAddressof the bound server socket before providing accepted sockets.Like server but provides the
InetSocketAddressof the bound server socket before providing accepted sockets.The outer stream first emits a left value specifying the bound address followed by right values -- one per client connection.
-
object
Socket
- Attributes
- protected