fs2.io.net

package fs2.io.net

Type members

Classlikes

class BindException(message: String, cause: Throwable) extends SocketException
Companion
object
Companion
class
class ConnectException(message: String, cause: Throwable) extends SocketException
Companion
object
Companion
class
final case class Datagram(remote: SocketAddress[IpAddress], bytes: Chunk[Byte])

A single datagram to send to the specified remote address or received from the specified address.

A single datagram to send to the specified remote address or received from the specified address.

Value Params
bytes

data to send/receive

remote

remote party to send/receive datagram to/from

trait DatagramSocket[F[_]] extends DatagramSocketPlatform[F]

Provides the ability to read/write from a UDP socket in the effect F.

Provides the ability to read/write from a UDP socket in the effect F.

Companion
object
object DatagramSocket extends DatagramSocketCompanionPlatform
Companion
class
trait DatagramSocketGroup[F[_]]

Specifies a socket option on a TCP/UDP socket.

Specifies a socket option on a TCP/UDP socket.

The companion provides methods for creating a socket option from each of the JDK java.net.StandardSocketOptions as well as the ability to construct arbitrary additional options. See the docs on StandardSocketOptions for details on each.

Companion
object
Companion
class
sealed trait Network[F[_]] extends NetworkPlatform[F] with SocketGroup[F] with DatagramSocketGroup[F]

Provides the ability to work with TCP, UDP, and TLS.

Provides the ability to work with TCP, UDP, and TLS.

Example
import fs2.Stream
import fs2.io.net.{Datagram, Network}
def send[F[_]: Network](datagram: Datagram): F[Unit] =
 Network[F].openDatagramSocket().use { socket =>
   socket.write(packet)
 }

In this example, the F[_] parameter to send requires the Network constraint instead of requiring the much more powerful Async constraint. The Network instance has a set of global resources used for managing sockets. Alternatively, use the socketGroup and datagramSocketGroup operations to manage the lifecycle of underlying resources. An instance of Network is available for any effect F which has an Async[F] instance.

Companion
object
object Network extends NetworkCompanionPlatform
Companion
class
trait Socket[F[_]]

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.

Companion
object
object Socket extends SocketCompanionPlatform
Companion
class
class SocketException(message: String, cause: Throwable) extends IOException
Companion
object
Companion
class
trait SocketGroup[F[_]]

Supports creation of client and server TCP sockets that all share an underlying non-blocking channel group.

Supports creation of client and server TCP sockets that all share an underlying non-blocking channel group.

sealed trait SocketOption

Specifies a socket option on a TCP/UDP socket.

Specifies a socket option on a TCP/UDP socket.

The companion provides methods for creating a socket option from each of the JDK java.net.StandardSocketOptions as well as the ability to construct arbitrary additional options. See the docs on StandardSocketOptions for details on each.

Companion
object
object SocketOption extends SocketOptionCompanionPlatform
Companion
class
class SocketTimeoutException(message: String, cause: Throwable) extends IOException
Companion
object
class UnknownHostException(message: String, cause: Throwable) extends IOException
Companion
object
Companion
class