ca.uhn.hl7v2.protocol.impl
Class ServerSocketStreamSource
java.lang.Object
ca.uhn.hl7v2.protocol.impl.SocketStreamSource
ca.uhn.hl7v2.protocol.impl.ServerSocketStreamSource
- All Implemented Interfaces:
- StreamSource
public class ServerSocketStreamSource
- extends SocketStreamSource
A 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).
- Version:
- $Revision: 1.4 $ updated on $Date: 2009-12-19 20:01:20 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
|
Field Summary |
static int |
TIMEOUT
The default SO_TIMEOUT value for sockets returned by this class |
|
Method Summary |
void |
connect()
Accepts new connections on underlying ServerSocket, replacing
any existing socket with the new one, blocking until a connection
is available. |
Socket |
getSocket()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TIMEOUT
public static final int TIMEOUT
- The default SO_TIMEOUT value for sockets returned by this class
- See Also:
- Constant Field Values
ServerSocketStreamSource
public ServerSocketStreamSource(ServerSocket theServerSocket,
String theExpectedAddress)
throws TransportException
- Parameters:
theServerSocket - a ServerSocket at which to listen for incoming connectionstheExpectedAddress - the IP address from which to accept connections (null means
accept from any address)
- Throws:
TransportException
getSocket
public Socket getSocket()
- Specified by:
getSocket in class SocketStreamSource
- Returns:
- a socket from which input and output streams for message exchages
are to be obtained
- See Also:
SocketStreamSource.getSocket()
connect
public void connect()
throws TransportException
- Accepts new connections on underlying ServerSocket, replacing
any existing socket with the new one, blocking until a connection
is available. See
DualTransportConnector for a method of
connecting two TransportLayers in a way that avoids deadlock.
- Specified by:
connect in interface StreamSource- Specified by:
connect in class SocketStreamSource
- Throws:
TransportException- See Also:
StreamSource.connect()
Copyright © 2001-2012 University Health Network. All Rights Reserved.