SocketGroup

trait SocketGroup[F <: ([_$1] =>> Any)]
Supports creation of client and server TCP sockets that all share
an underlying non-blocking channel group.
class Object
trait Matchable
class Any
trait Network[F]

Value members

Methods

def client(to: SocketAddress[Host], options: List[SocketOption]): Resource[F, Socket[F]]
Opens a TCP connection to the specified server.
The connection is closed when the resource is released.
Value Params
options
socket options to apply to the underlying socket
to
address of remote server
def server(address: Option[Host], port: Option[Port], options: List[SocketOption]): Stream[F, Socket[F]]
Creates a TCP server bound to specified address/port and returns a stream of
client sockets -- one per client that connects to the bound address/port.
When the stream terminates, all open connections will terminate as well.
Value Params
address
address to accept connections from; none for all interfaces
options
socket options to apply to the underlying socket
port
port to bind
def serverResource(address: Option[Host], port: Option[Port], options: List[SocketOption]): Resource[F, (SocketAddress[IpAddress], Stream[F, Socket[F]])]
Like server but provides the SocketAddress of the bound server socket before providing accepted sockets.