object tcp
- Source
- tcp.scala
- Alphabetic
- By Inheritance
- tcp
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- lazy val DefaultAsynchronousChannelGroup: AsynchronousChannelGroup
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
available(maxBytes: Int, timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Option[ByteVector]]
Read up to
numBytesfrom the peer.Read up to
numBytesfrom the peer. Iftimeoutis provided and no data arrives within the specified duration, the returnedProcessfails with a java.nio.channels.InterruptedByTimeoutException. IfallowPeerClosedistrue, abrupt termination by the peer is converted toNonerather than being raised as an exception. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
connect[A](to: InetSocketAddress, reuseAddress: Boolean = true, sendBufferSize: Int = 256 * 1024, receiveBufferSize: Int = 256 * 1024, keepAlive: Boolean = false, noDelay: Boolean = false)(output: Process[Connection, A])(implicit AG: AsynchronousChannelGroup, S: Strategy): Process[Task, A]
Process that connects to remote server (TCP) and runs the stream
ouput.Process that connects to remote server (TCP) and runs the stream
ouput.- to
Address of remote server
- reuseAddress
whether address has to be reused (@see java.net.StandardSocketOptions.SO_REUSEADDR)
- sendBufferSize
size of send buffer (@see java.net.StandardSocketOptions.SO_SNDBUF)
- receiveBufferSize
size of receive buffer (@see java.net.StandardSocketOptions.SO_RCVBUF)
- keepAlive
whether keep-alive on tcp is used (@see java.net.StandardSocketOptions.SO_KEEPALIVE)
- noDelay
whether tcp no-delay flag is set (@see java.net.StandardSocketOptions.TCP_NODELAY)
-
def
eof: Process[Connection, Nothing]
Indicate to the peer that we are done writing.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval[A](t: Task[A]): Process[Connection, A]
Evaluate and emit the result of
t. -
def
eval_[A](t: Task[A]): Process[Connection, Nothing]
Evaluate and ignore the result of
t. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lastWrites(chunks: Process[Connection, ByteVector], timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Unit]
Defined as
tcp.writes(chunks,timeout,allowPeerClosed) onComplete eof. -
def
lastWrites_(chunks: Process[Connection, ByteVector], timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Nothing]
Like scalaz.stream.tcp.lastWrites, but ignores the output.
-
def
lift[A](p: Process[Task, A]): Process[Connection, A]
Lift a regular
Processto operate in the context of aConnection. - def local[A](f: (Socket) ⇒ Socket)(p: Process[Connection, A]): Process[Connection, A]
-
def
localAddress: Process[Connection, InetSocketAddress]
Returns a single-element stream containing the local address of the connection.
- def merge[A](a: Process[Connection, A], a2: Process[Connection, A])(implicit S: Strategy): Process[Connection, A]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
read(numBytes: Int, timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Option[ByteVector]]
Read exactly
numBytesfrom the peer in a single chunk.Read exactly
numBytesfrom the peer in a single chunk. Iftimeoutis provided and no data arrives within the specified duration, the returnedProcessfails with a java.nio.channels.InterruptedByTimeoutException. -
def
reads(maxChunkBytes: Int, timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, ByteVector]
Read a stream from the peer in chunk sizes up to
maxChunkBytesbytes. -
def
remoteAddress: Process[Connection, InetSocketAddress]
Returns a single-element stream containing the remote address of the peer.
-
def
server[A](bind: InetSocketAddress, concurrentRequests: Int, maxQueued: Int = 0, reuseAddress: Boolean = true, receiveBufferSize: Int = 256 * 1024)(handler: Process[Connection, A])(implicit AG: AsynchronousChannelGroup, S: Strategy): Process[Task, Process[Task, \/[Throwable, A]]]
Process that binds to supplied address and handles incoming TCP connections using the specified handler.
Process that binds to supplied address and handles incoming TCP connections using the specified handler. The stream of handler results is returned, along with any errors. The outer stream scopes the lifetime of the server socket. When the returned process terminates, all open connections will terminate as well.
- bind
address to which this process has to be bound
- concurrentRequests
the number of requests that may be processed simultaneously, must be positive
- reuseAddress
whether address has to be reused (@see java.net.StandardSocketOptions.SO_REUSEADDR)
- receiveBufferSize
size of receive buffer (@see java.net.StandardSocketOptions.SO_RCVBUF)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
write(bytes: ByteVector, timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Unit]
Write
bytesto the peer.Write
bytesto the peer. Iftimeoutis provided and the operation does not complete in the specified duration, the returnedProcessfails with a java.nio.channels.InterruptedByTimeoutException. -
def
write_(bytes: ByteVector, timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Nothing]
Like scalaz.stream.tcp.write, but ignores the output.
-
def
writes(chunks: Process[Connection, ByteVector], timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Unit]
Write a stream of chunks to the peer.
Write a stream of chunks to the peer. Emits a single
Unitvalue for each chunk written. -
def
writes_(chunks: Process[Connection, ByteVector], timeout: Option[Duration] = None, allowPeerClosed: Boolean = false): Process[Connection, Nothing]
Like scalaz.stream.tcp.writes, but ignores the output.
- def wye[A, B, C](a: Process[Connection, A], b: Process[Connection, B])(y: Wye[A, B, C])(implicit S: Strategy): Process[Connection, C]
- object syntax