|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.ccaffeine.dc.distributed.SocketConnectionMgr
public class SocketConnectionMgr
This class manages a set of connections (either one client connection to a server or many connections from clients). The connections in this manager are implemented using sockets, and can be reconnected through the manager. Reconnection of a socket connection does not always mean you get a socket connected to the same client you had before you disconnected - the client sockets may connect in a different order. Last modified by: $Author: baallan $
Constructor Summary | |
---|---|
SocketConnectionMgr(int numClients,
int port)
Construct a socket connection manager that acts as a server for the given number of clients on the given port. |
|
SocketConnectionMgr(int myProcNumber,
int serverPort,
ProcessorInfo[] machines)
Construct a socket connection manager based on an array of ProcessorInfo objects. |
|
SocketConnectionMgr(java.lang.String serverName,
int port)
Construct a socket connection manager that acts as a client for the given server name and port. |
|
SocketConnectionMgr(java.lang.String processorName,
java.lang.String procFile,
int port)
Construct a socket connection manager based on a processor file. |
Method Summary | |
---|---|
void |
acceptConnections(int timeout)
|
void |
connect(int timeout)
|
void |
connectToServer()
|
void |
disableConnection(Connection connection)
temporarily takes the connection out of service |
java.util.Vector |
getConnections()
|
int |
getNumConnected()
|
boolean |
isConnected()
|
boolean |
isServer()
|
void |
reconnect(int timeout)
|
protected void |
reconnectConnection(gov.sandia.ccaffeine.dc.distributed.SocketConnection connect,
int timeout)
|
void |
removeConnection(Connection connection)
|
void |
setConnectionNotification(gov.sandia.ccaffeine.dc.distributed.ConnectionNotification notif)
|
void |
shutdown()
Disconnect all connections and close the serverSocket, if one exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketConnectionMgr(int numClients, int port)
public SocketConnectionMgr(java.lang.String serverName, int port)
public SocketConnectionMgr(java.lang.String processorName, java.lang.String procFile, int port) throws java.lang.Exception
java.lang.Exception
public SocketConnectionMgr(int myProcNumber, int serverPort, ProcessorInfo[] machines)
ProcessorInfo
objects. Typically the array will have been
constructed using a processor file (see previous constructor).
Method Detail |
---|
public void shutdown() throws java.io.IOException
java.io.IOException
public void acceptConnections(int timeout) throws java.lang.Exception
java.lang.Exception
public void connectToServer() throws java.lang.Exception
java.lang.Exception
protected void reconnectConnection(gov.sandia.ccaffeine.dc.distributed.SocketConnection connect, int timeout) throws java.lang.Exception
java.lang.Exception
public boolean isServer()
public boolean isConnected()
public void connect(int timeout)
public java.util.Vector getConnections()
public void disableConnection(Connection connection)
public void removeConnection(Connection connection)
public void reconnect(int timeout) throws java.lang.Exception
java.lang.Exception
public int getNumConnected()
public void setConnectionNotification(gov.sandia.ccaffeine.dc.distributed.ConnectionNotification notif)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |