advancedrelay.laygo
Class ProtocolStackServer

java.lang.Object
  |
  +--advancedrelay.laygo.ProtocolStackServer

public class ProtocolStackServer
extends java.lang.Object

Encapsulates access to the LayGO RPC Server.

There is only one server connection, but methods are not declared static because of synchronization. There should be only one ProtocolStackServer object connected at any time.

All connect() methods automatically start heartbeating with the server. Module clients should not normally need to call heartbeat().


Constructor Summary
ProtocolStackServer()
           
 
Method Summary
 void connect()
          Connects to the server on the local machine
 void connect(int id)
          Connects to the server by name
 void connect(java.lang.String address)
          Connects to the server by IP address
 void disconnect()
          Disconnects from the server.
 void heartbeat()
          Sends a heartbeat message to the server.
 boolean isConnected()
          Returns true if currently connected to the server, false otherwise.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolStackServer

public ProtocolStackServer()
Method Detail

connect

public void connect()
             throws ProtocolStackException
Connects to the server on the local machine

Throws:
ProtocolStackException - The reason for failure.

connect

public void connect(int id)
             throws ProtocolStackException
Connects to the server by name

Parameters:
id - Id of server to connect to
Throws:
ProtocolStackException - The reason for failure.

connect

public void connect(java.lang.String address)
             throws ProtocolStackException
Connects to the server by IP address

Parameters:
address - IP address of server to connect to
Throws:
ProtocolStackException - The reason for failure.

disconnect

public void disconnect()
                throws ProtocolStackException
Disconnects from the server.

Throws:
ProtocolStackException - The reason for failure.

heartbeat

public void heartbeat()
Sends a heartbeat message to the server.


isConnected

public boolean isConnected()
Returns true if currently connected to the server, false otherwise.