Class ServerSocketTransportFactory

java.lang.Object
io.bytestreams.exchange.core.ServerSocketTransportFactory
All Implemented Interfaces:
TransportFactory, Closeable, AutoCloseable

public final class ServerSocketTransportFactory extends Object implements TransportFactory, Closeable
A TransportFactory that accepts incoming TCP connections on a ServerSocket.

Each call to create() blocks until a client connects, applies the SocketConfigurator to the accepted socket, and returns a SocketTransport.

The factory owns the ServerSocket and binds it eagerly in ServerSocketTransportFactory.Builder.build(). Close the factory to stop accepting connections.

Use builder(int) to configure the bind address, backlog, and socket options.