fs2.io.net

package fs2.io.net

Provides support for doing network I/O -- TCP, UDP, and TLS.

Attributes

Members list

Packages

package fs2.io.net.tls

Type members

Classlikes

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 parameters

bytes

data to send/receive

remote

remote party to send/receive datagram to/from

Attributes

Source
Datagram.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait DatagramSocket[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.

Attributes

Companion
object
Source
DatagramSocket.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait DTLSSocket[F]

Attributes

Companion
trait
Source
DatagramSocket.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
DatagramSocketGroup.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Network[F]
sealed trait Network[F[_]] extends SocketGroup[F], DatagramSocketGroup[F]

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

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

Attributes

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. An instance of Network is available for any effect F which has a LiftIO[F] instance.

Companion
object
Source
Network.scala
Supertypes
trait SocketGroup[F]
class Object
trait Matchable
class Any
object Network

Attributes

Companion
trait
Source
Network.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Network.type
sealed trait ServerSocket[F[_]] extends SocketInfo[F]

Represents a bound TCP server socket.

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
Supertypes
trait SocketInfo[F]
class Object
trait Matchable
class Any
object ServerSocket

Attributes

Companion
trait
Source
ServerSocket.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait Socket[F[_]] extends SocketInfo[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.

Attributes

Companion
object
Source
Socket.scala
Supertypes
trait SocketInfo[F]
class Object
trait Matchable
class Any
Known subtypes
trait TLSSocket[F]
object Socket

Attributes

Companion
trait
Source
Socket.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Socket.type
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.

Attributes

Source
SocketGroup.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Network[F]
trait SocketInfo[F[_]]

Information about a connected socket.

Information about a connected socket. Super trait of both ServerSocket and Socket.

Attributes

Companion
object
Source
SocketInfo.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ServerSocket[F]
trait Socket[F]
trait TLSSocket[F]
object SocketInfo

Attributes

Companion
trait
Source
SocketInfo.scala
Supertypes
class Object
trait Matchable
class Any
Self type
SocketInfo.type
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.

Attributes

Companion
object
Source
SocketOption.scala
Supertypes
class Object
trait Matchable
class Any
object SocketOption

Attributes

Companion
trait
Source
SocketOption.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type BindException = BindException

Attributes

Source
net.scala
type ConnectException = ConnectException

Attributes

Source
net.scala

Attributes

Source
net.scala
type ProtocolException = ProtocolException

Attributes

Source
net.scala
type SocketException = SocketException

Attributes

Source
net.scala
type SocketTimeoutException = SocketTimeoutException

Attributes

Source
net.scala

Deprecated types

Attributes

Deprecated
true
Source
net.scala

Value members

Concrete fields

Attributes

Source
net.scala