Package 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
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
FieldsModifier and TypeFieldDescriptionstatic final intThe default SO_TIMEOUT value for sockets returned by this class -
Constructor Summary
ConstructorsConstructorDescriptionServerSocketStreamSource(ServerSocket theServerSocket, String theExpectedAddress) -
Method Summary
Methods inherited from class ca.uhn.hl7v2.protocol.impl.SocketStreamSource
disconnect, getInboundStream, getOutboundStream
-
Field Details
-
TIMEOUT
The default SO_TIMEOUT value for sockets returned by this class- See Also:
-
-
Constructor Details
-
ServerSocketStreamSource
- 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)
-
-
Method Details
-
getSocket
- Specified by:
getSocketin classSocketStreamSource- Returns:
- a socket from which input and output streams for message exchages are to be obtained
- See Also:
-
connect
Accepts new connections on underlying ServerSocket, replacing any existing socket with the new one, blocking until a connection is available. SeeDualTransportConnectorfor a method of connecting twoTransportLayers in a way that avoids deadlock.- Specified by:
connectin interfaceStreamSource- Specified by:
connectin classSocketStreamSource- See Also:
-