public class ServerSocketStreamSource extends SocketStreamSource
StreamSource
that gets streams from ServerSockets. This
allows you to communicate over sockets that are established by the remote
party (ie as a TCP/IP server).Modifier and Type | Field and Description |
---|---|
static int |
TIMEOUT
The default SO_TIMEOUT value for sockets returned by this class
|
Constructor and Description |
---|
ServerSocketStreamSource(ServerSocket theServerSocket,
String theExpectedAddress) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Accepts new connections on underlying ServerSocket, replacing
any existing socket with the new one, blocking until a connection
is available.
|
Socket |
getSocket() |
disconnect, getInboundStream, getOutboundStream
public static final int TIMEOUT
public ServerSocketStreamSource(ServerSocket theServerSocket, String theExpectedAddress) throws TransportException
theServerSocket
- a ServerSocket at which to listen for incoming connectionstheExpectedAddress
- the IP address from which to accept connections (null means
accept from any address)TransportException
public Socket getSocket()
getSocket
in class SocketStreamSource
SocketStreamSource.getSocket()
public void connect() throws TransportException
DualTransportConnector
for a method of
connecting two TransportLayer
s in a way that avoids deadlock.connect
in interface StreamSource
connect
in class SocketStreamSource
TransportException
StreamSource.connect()
Copyright © 2001–2017 University Health Network. All rights reserved.