unitee.client
Class SocketManager

java.lang.Object
  |
  +--unitee.client.SocketManager

public class SocketManager
extends java.lang.Object

Responsible to manage sockets used to invocate remote methods. The factory tries to reuse already open connections that were "closed" by calling destroySocket().


Constructor Summary
SocketManager(java.lang.String host)
           
SocketManager(java.lang.String host, int port)
           
 
Method Summary
 void closeSocket(java.net.Socket socket)
           
 java.net.Socket createSocket()
           
static void destructInstance()
          Destructs the SocketManager instance and the associated sockets.
protected  void finalize()
           
static SocketManager getInstance()
           
static void setInstance(SocketManager m)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketManager

public SocketManager(java.lang.String host)
              throws java.io.IOException

SocketManager

public SocketManager(java.lang.String host,
                     int port)
              throws java.io.IOException
Method Detail

createSocket

public java.net.Socket createSocket()
                             throws java.io.IOException

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

closeSocket

public void closeSocket(java.net.Socket socket)
                 throws java.io.IOException

destructInstance

public static void destructInstance()
Destructs the SocketManager instance and the associated sockets.

setInstance

public static void setInstance(SocketManager m)

getInstance

public static SocketManager getInstance()