org.exolab.core.ipc
Class Server

java.lang.Object
  extended byorg.exolab.core.ipc.Server
All Implemented Interfaces:
java.lang.Runnable

public class Server
extends java.lang.Object
implements java.lang.Runnable

The main entry point for Ipc server connections. Create and start the appropriate service for a server.

Version:
$Revision: 1.3 $ $Date: 2003/06/19 05:58:52 $
Author:
Jim Mourikis
See Also:
TcpServerService

Constructor Summary
Server(java.net.InetAddress address, int port, NotifierIfc notifier)
          Construct an appropriate service with the given port number.
Server(int port, NotifierIfc notifier)
          Construct an appropriate service with the given port number.
Server(NotifierIfc notifier)
          Instantiate an appropriate service.
 
Method Summary
 java.lang.String getHost()
          Return the machines address.
 int getPort()
          Return the port number this server is listening on.
 void run()
          Start the service running.
 void stop()
          Shutdown the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server(NotifierIfc notifier)
       throws java.io.IOException
Instantiate an appropriate service. Pass in a notifier handle to receive notifications of messages received.

Parameters:
notifier - The client handle to call when data is received.

Server

public Server(int port,
              NotifierIfc notifier)
       throws java.io.IOException
Construct an appropriate service with the given port number. Pass in a notifier handle to receive notifications of messages received.

Parameters:
port - The port to connect on.
notifier - The client handle to call when data is received.

Server

public Server(java.net.InetAddress address,
              int port,
              NotifierIfc notifier)
       throws java.io.IOException
Construct an appropriate service with the given port number. Pass in a notifier handle to receive notifications of messages received.

Parameters:
address - the local IP address to bind to. May be null.
port - the port to connect on.
notifier - the client handle to call when data is received.
Method Detail

stop

public void stop()
Shutdown the service.


getPort

public int getPort()
Return the port number this server is listening on.

Returns:
the port number the server is using.

getHost

public java.lang.String getHost()
Return the machines address.

Returns:
the machines IP address.

run

public void run()
Start the service running. This call never returns until the service is shutdown.

Specified by:
run in interface java.lang.Runnable


Copyright © 1999-2005 The Exolab Group. All Rights Reserved.