Socket

fs2.io.net.Socket
See theSocket companion object
trait Socket[F[_]] extends SocketInfo[F]

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

Attributes

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

Members list

Value members

Abstract methods

def endOfInput: F[Unit]

Indicates that this channel will not read more data.

Indicates that this channel will not read more data. Causes End-Of-Stream be signalled to available. This is a no-op on Node.js.

Attributes

Source
Socket.scala
def endOfOutput: F[Unit]

Indicates to peer that we are done writing.

Indicates to peer that we are done writing. *

Attributes

Source
Socket.scala

Gets the remote address of this socket.

Gets the remote address of this socket.

Attributes

Source
Socket.scala

Reads up to maxBytes from the peer.

Reads up to maxBytes from the peer.

Returns None if the "end of stream" is reached, indicating there will be no more bytes sent.

Attributes

Source
Socket.scala
def readN(numBytes: Int): F[Chunk[Byte]]

Reads exactly numBytes from the peer in a single chunk.

Reads exactly numBytes from the peer in a single chunk.

Returns a chunk with size < numBytes upon reaching the end of the stream.

Attributes

Source
Socket.scala
def reads: Stream[F, Byte]

Reads bytes from the socket as a stream.

Reads bytes from the socket as a stream.

Attributes

Source
Socket.scala
def write(bytes: Chunk[Byte]): F[Unit]

Writes bytes to the peer.

Writes bytes to the peer.

Completes when the bytes are written to the socket.

Attributes

Source
Socket.scala
def writes: (F, Byte) => Nothing

Writes the supplied stream of bytes to this socket via write semantics.

Writes the supplied stream of bytes to this socket via write semantics.

Attributes

Source
Socket.scala

Concrete methods

Reads a file and writes it to a socket.

Reads a file and writes it to a socket. Streams the file contents of the specified size and sends them over the socket. The stream terminates when the entire file has reached end of file or the specified count is reached.

Value parameters

chunkSize

the size of each chunk to read

count

the maximum number of bytes to transfer

file

the file handle to read from

offset

the starting position in the file

Attributes

Source
Socket.scala

Deprecated methods

def isOpen: F[Boolean]

Attributes

Deprecated
true
Source
Socket.scala

Attributes

Deprecated
true
Source
Socket.scala

Attributes

Deprecated
true
Source
Socket.scala

Inherited and Abstract methods

Local address of this socket.

Local address of this socket.

Attributes

Inherited from:
SocketInfo
Source
SocketInfo.scala
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