org.apache.pekko.stream.connectors.unixdomainsocket.scaladsl
UnixDomainSocket
Companion object UnixDomainSocket
final class UnixDomainSocket extends UnixDomainSocketImpl
Provides Unix Domain Socket functionality to Pekko Streams with an interface similar to Akka's Tcp class.
- Source
- UnixDomainSocket.scala
- Alphabetic
- By Inheritance
- UnixDomainSocket
- UnixDomainSocketImpl
- Extension
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new UnixDomainSocket(system: ExtendedActorSystem)
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bind(path: Path, backlog: Int = 128, halfClose: Boolean = false): Source[IncomingConnection, Future[ServerBinding]]
Creates a UnixDomainSocket.ServerBinding instance which represents a prospective Unix Domain Socket server binding on the given
endpoint
.Creates a UnixDomainSocket.ServerBinding instance which represents a prospective Unix Domain Socket server binding on the given
endpoint
.Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing pekko.stream.scaladsl.RunnableGraph the server is not immediately available. Only after the materialized future completes is the server ready to accept client connections.
TODO: Support idleTimeout as per Tcp.
- path
The path to listen on
- backlog
Controls the size of the connection backlog
- halfClose
Controls whether the connection is kept open even after writing has been completed to the accepted socket connections. If set to true, the connection will implement the socket half-close mechanism, allowing the client to write to the connection even after the server has finished writing. The socket is only closed after both the client and server finished writing. If set to false, the connection will immediately closed once the server closes its write side, independently whether the client is still attempting to write. This setting is recommended for servers, and therefore it is the default setting.
- Definition Classes
- UnixDomainSocket → UnixDomainSocketImpl
- def bindAndHandle(handler: Flow[ByteString, ByteString, _], path: Path, backlog: Int = 128, halfClose: Boolean = false): Future[ServerBinding]
Creates a UnixDomainSocket.ServerBinding instance which represents a prospective Unix Socket server binding on the given
endpoint
handling the incoming connections using the provided Flow.Creates a UnixDomainSocket.ServerBinding instance which represents a prospective Unix Socket server binding on the given
endpoint
handling the incoming connections using the provided Flow.Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing pekko.stream.scaladsl.RunnableGraph the server is not immediately available. Only after the returned future completes is the server ready to accept client connections.
TODO: Support idleTimeout as per Tcp.
- handler
A Flow that represents the server logic
- path
The path to listen on
- backlog
Controls the size of the connection backlog
- halfClose
Controls whether the connection is kept open even after writing has been completed to the accepted socket connections. If set to true, the connection will implement the socket half-close mechanism, allowing the client to write to the connection even after the server has finished writing. The socket is only closed after both the client and server finished writing. If set to false, the connection will immediately closed once the server closes its write side, independently whether the client is still attempting to write. This setting is recommended for servers, and therefore it is the default setting.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logSource: Class[_]
Override to customise reported log source
Override to customise reported log source
- Attributes
- protected
- Definition Classes
- UnixDomainSocketImpl
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def outgoingConnection(path: Path): Flow[ByteString, ByteString, Future[OutgoingConnection]]
Creates an UnixDomainSocket.OutgoingConnection without specifying options.
Creates an UnixDomainSocket.OutgoingConnection without specifying options. It represents a prospective Unix Domain client connection to the given endpoint.
Note that the ByteString chunk boundaries are not retained across the network, to achieve application level chunks you have to introduce explicit framing in your streams, for example using the pekko.stream.scaladsl.Framing stages.
- def outgoingConnection(remoteAddress: UnixSocketAddress, localAddress: Option[UnixSocketAddress] = None, halfClose: Boolean = true, connectTimeout: Duration = Duration.Inf): Flow[ByteString, ByteString, Future[OutgoingConnection]]
Creates an UnixDomainSocket.OutgoingConnection instance representing a prospective Unix Domain client connection to the given endpoint.
Creates an UnixDomainSocket.OutgoingConnection instance representing a prospective Unix Domain client connection to the given endpoint.
Note that the ByteString chunk boundaries are not retained across the network, to achieve application level chunks you have to introduce explicit framing in your streams, for example using the pekko.stream.scaladsl.Framing stages.
TODO: Support idleTimeout as per Tcp.
- remoteAddress
The remote address to connect to
- localAddress
Optional local address for the connection
- halfClose
Controls whether the connection is kept open even after writing has been completed to the accepted socket connections. If set to true, the connection will implement the socket half-close mechanism, allowing the server to write to the connection even after the client has finished writing. The socket is only closed after both the client and server finished writing. This setting is recommended for clients and therefore it is the default setting. If set to false, the connection will immediately closed once the client closes its write side, independently whether the server is still attempting to write.
- Definition Classes
- UnixDomainSocket → UnixDomainSocketImpl
- 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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()