com.sri.oaa2.com
Class LibComTcpConnection

java.lang.Object
  |
  +--com.sri.oaa2.com.LibComTcpConnection
All Implemented Interfaces:
LibComConnection

public class LibComTcpConnection
extends java.lang.Object
implements LibComConnection

Provides low-level communications methods for the agentlib


Field Summary
protected  boolean connected
           
static java.lang.String copyright
          Copyright and version information.
protected  LibComClient mClient
           
protected  java.lang.String[] mCmdLine
           
protected  java.lang.String mConnectionId
           
static java.lang.String rcsId
           
 
Constructor Summary
LibComTcpConnection(LibComClient inClient, java.lang.String inConnectionId)
           
LibComTcpConnection(LibComClient client, java.lang.String connectionId, java.lang.String[] cmdLine)
          Constructor
 
Method Summary
 IclTerm cnx_CanonicalAddress(IclTerm address)
          Returns address tcp(IPAddr,Port) to connected socket.
 boolean cnx_Connect(IclTerm address, IclTerm params)
          Opens a Socket connection on a Host at Port
 void cnx_Disconnect()
          Closes the Socket connection
 boolean cnx_IsConnected()
          LibComConnection public LibComConnection(LibComClient client, String connectionId, String[] cmdLine) { mClient = client; mConnectionId = connectionId; mCmdLine = cmdLine; connected = false; };
 boolean cnx_ListenAt(IclTerm address, IclTerm params)
           
 boolean cnx_sendMsg(IclTerm t)
           
 boolean cnx_sendMsgFormatWriter(IclTerm t)
           
 IclTerm getClientAddress()
           
 java.lang.String[] getCmdLine()
           
 IclTerm getListenAddress()
           
 void setLibComListener(LibComListener listener)
           
 void setLibComServerListener(LibComServerListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright and version information.

See Also:
Constant Field Values

rcsId

public static final java.lang.String rcsId
See Also:
Constant Field Values

connected

protected boolean connected

mClient

protected LibComClient mClient

mConnectionId

protected java.lang.String mConnectionId

mCmdLine

protected java.lang.String[] mCmdLine
Constructor Detail

LibComTcpConnection

public LibComTcpConnection(LibComClient client,
                           java.lang.String connectionId,
                           java.lang.String[] cmdLine)
Constructor


LibComTcpConnection

public LibComTcpConnection(LibComClient inClient,
                           java.lang.String inConnectionId)
Method Detail

cnx_IsConnected

public boolean cnx_IsConnected()
Description copied from interface: LibComConnection
LibComConnection public LibComConnection(LibComClient client, String connectionId, String[] cmdLine) { mClient = client; mConnectionId = connectionId; mCmdLine = cmdLine; connected = false; };

Specified by:
cnx_IsConnected in interface LibComConnection

getCmdLine

public java.lang.String[] getCmdLine()
Specified by:
getCmdLine in interface LibComConnection

cnx_CanonicalAddress

public IclTerm cnx_CanonicalAddress(IclTerm address)
Returns address tcp(IPAddr,Port) to connected socket. Must be connected first, for this to work! Currently, assumes client connection (should change!)

Specified by:
cnx_CanonicalAddress in interface LibComConnection

cnx_Connect

public boolean cnx_Connect(IclTerm address,
                           IclTerm params)
Opens a Socket connection on a Host at Port

Specified by:
cnx_Connect in interface LibComConnection

cnx_sendMsg

public boolean cnx_sendMsg(IclTerm t)
Specified by:
cnx_sendMsg in interface LibComConnection

cnx_sendMsgFormatWriter

public boolean cnx_sendMsgFormatWriter(IclTerm t)
Specified by:
cnx_sendMsgFormatWriter in interface LibComConnection

cnx_Disconnect

public void cnx_Disconnect()
Closes the Socket connection

Specified by:
cnx_Disconnect in interface LibComConnection

cnx_ListenAt

public boolean cnx_ListenAt(IclTerm address,
                            IclTerm params)
Specified by:
cnx_ListenAt in interface LibComConnection

getListenAddress

public IclTerm getListenAddress()
Specified by:
getListenAddress in interface LibComConnection

getClientAddress

public IclTerm getClientAddress()
Specified by:
getClientAddress in interface LibComConnection

setLibComServerListener

public void setLibComServerListener(LibComServerListener listener)
Specified by:
setLibComServerListener in interface LibComConnection

setLibComListener

public void setLibComListener(LibComListener listener)
Specified by:
setLibComListener in interface LibComConnection