ServerSocket

fs2.io.net.ServerSocket
See theServerSocket companion object
sealed trait ServerSocket[F[_]] extends SocketInfo[F]

Represents a bound TCP server socket.

Note some platforms do not support getting and setting socket options on server sockets so take care when using getOption and setOption.

Client sockets can be accepted by pulling on the accept stream. A concurrent server that is limited to maxAccept concurrent clients is accomplished by b.accept.map(handleClientSocket).parJoin(maxAccept).

Attributes

Companion
object
Source
ServerSocket.scala
Graph
Supertypes
trait SocketInfo[F]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def accept: Stream[F, Socket[F]]

Stream of client sockets; typically processed concurrently to allow concurrent clients.

Stream of client sockets; typically processed concurrently to allow concurrent clients.

Attributes

Source
ServerSocket.scala

Local address of this socket.

Local address of this socket.

Attributes

Source
ServerSocket.scala

Inherited and Abstract methods

def getOption[A](key: SocketOption[A]): F[Option[A]]

Gets the value of the specified option, if defined.

Gets the value of the specified option, if defined.

Attributes

Inherited from:
SocketInfo
Source
SocketInfo.scala
def setOption[A](key: SocketOption[A], value: A): F[Unit]

Sets the specified option to the supplied value.

Sets the specified option to the supplied value.

Attributes

Inherited from:
SocketInfo
Source
SocketInfo.scala
def supportedOptions: F[Set[SocketOption[_]]]

Gets the set of options that may be used with setOption.

Gets the set of options that may be used with setOption. Note some options may not support getOption.

Attributes

Inherited from:
SocketInfo
Source
SocketInfo.scala