com.interfaceware.chameleon
Class Hl7ServerSocket

java.lang.Object
  extended by com.interfaceware.chameleon.Hl7ServerSocket
Direct Known Subclasses:
TransportTcpIpServer

public class Hl7ServerSocket
extends java.lang.Object

This class is deprecated and should not be used for new applications. This class allows you to connect to hosts and send messages


Constructor Summary
Hl7ServerSocket()
          Construct a Server
 
Method Summary
 void closeConnection(long TransportId)
          Close a connection This does a graceful close which means it is still possible to receive some data that has already been sent by the client.
protected  void finalize()
          Frees the server handle.
 void hardCloseConnection(long TransportId)
          Close a connection This does a non-graceful close.
 void listen(int Port)
          Makes server listen on a specified port.
 void onClose(long TransportId)
          Called when a connection closes.
 void onError(int ErrorId, java.lang.String ErrorMessage)
          Called when an error occurs.
 void onMessage(long TransportId, java.lang.String Message)
          Called when a message arrives.
 Hl7ClientSocket onNewConnection(long TransportId)
          Called when there is a new connection.
 void onTransportError(long TransportId, int ErrorId, java.lang.String ErrorMessage)
          Called when an error occurs on a connection.
 void sendMessage(long TransportId, java.lang.String Message)
          Send a message
 void stopListening()
          Stops the server from listening
static void stopNetworkingThread()
          Call this method to stop the networking thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hl7ServerSocket

public Hl7ServerSocket()
Construct a Server

Throws:
ChameleonException
Method Detail

finalize

protected void finalize()
                 throws ChameleonException
Frees the server handle.

Overrides:
finalize in class java.lang.Object
Throws:
ChameleonException

listen

public void listen(int Port)
            throws ChameleonException
Makes server listen on a specified port.

Throws:
ChameleonException

stopListening

public void stopListening()
                   throws ChameleonException
Stops the server from listening

Throws:
ChameleonException

sendMessage

public void sendMessage(long TransportId,
                        java.lang.String Message)
                 throws ChameleonException
Send a message

Throws:
ChameleonException

closeConnection

public void closeConnection(long TransportId)
                     throws ChameleonException
Close a connection This does a graceful close which means it is still possible to receive some data that has already been sent by the client. For a hard shutdown use hardCloseConnection instead.

Throws:
ChameleonException

hardCloseConnection

public void hardCloseConnection(long TransportId)
                         throws ChameleonException
Close a connection This does a non-graceful close. For a graceful shutdown use closeConnection instead.

Throws:
ChameleonException

onNewConnection

public Hl7ClientSocket onNewConnection(long TransportId)
Called when there is a new connection. Should be overridden.


onError

public void onError(int ErrorId,
                    java.lang.String ErrorMessage)
Called when an error occurs. Should be overridden.


onTransportError

public void onTransportError(long TransportId,
                             int ErrorId,
                             java.lang.String ErrorMessage)
Called when an error occurs on a connection. Should be overridden.


onClose

public void onClose(long TransportId)
Called when a connection closes. Should be overridden.


onMessage

public void onMessage(long TransportId,
                      java.lang.String Message)
Called when a message arrives. Should be overridden.


stopNetworkingThread

public static void stopNetworkingThread()
                                 throws ChameleonException
Call this method to stop the networking thread

Throws:
ChameleonException