J-Sim v1.2.1-p7 API

drcl.inet.socket
Class InetSocket

java.lang.Object
  extended bydrcl.inet.socket.InetSocket
All Implemented Interfaces:
SocketStates

public class InetSocket
extends java.lang.Object
implements SocketStates

This class implements a "socket" equivalent API for application components in the INET framework. It has nothing to do with JavaSimSocketImpl.


Field Summary
 Port controlPort
           
 Port dataPort
           
 
Fields inherited from interface drcl.inet.socket.SocketStates
ACCEPTING, CLOSED, CLOSING, CONNECTED, CONNECTING, INIT, NO_OP, STATES
 
Constructor Summary
InetSocket(long localAddress_, Port dataPort_, Port controlPort_)
           
InetSocket(Port dataPort_, Port controlPort_)
           
 
Method Summary
 void aAccept(java.lang.Object msgID_)
          Asynchronized version of accept().
 InetSocket aAcceptFinished(SocketContract.Message reply_, Port dataPort_)
          finishes an asynchronous "accept" when receiving an accept-reply.
 InetSocket accept(Port dataPort_)
           
 void aClose(java.lang.Object msgID_)
          Asynchronized version of close().
 void aCloseFinished(SocketContract.Message reply_)
          finishes an asynchronous "accept" when receiving an accept-reply.
 void aConnect(long remoteAddress_, int port_, java.lang.Object msgID_)
          Asynchronized version of connect().
 void aConnectFinished(SocketContract.Message reply_)
          finishes an asynchronous "connect" when receiving an connect-reply.
 int available()
           
 void bind(long localAddr_, int localPort_)
           
 void close()
           
 void connect(long remoteAddress_, int port_)
           
 java.io.InputStream getInputStream()
           
 long getLocalAddress()
           
 int getLocalPort()
           
 java.lang.Object getOption(int optID)
          Not implemented.
 java.io.OutputStream getOutputStream()
           
 long getRemoteAddress()
           
 int getRemotePort()
           
 void listen(int backlog)
           
 void sendUrgentData(int data)
          Not implemented.
 void setOption(int optID, java.lang.Object value)
          Not implemented.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataPort

public Port dataPort

controlPort

public Port controlPort
Constructor Detail

InetSocket

public InetSocket(Port dataPort_,
                  Port controlPort_)

InetSocket

public InetSocket(long localAddress_,
                  Port dataPort_,
                  Port controlPort_)
Method Detail

getRemotePort

public int getRemotePort()

getLocalPort

public int getLocalPort()

getRemoteAddress

public long getRemoteAddress()

getLocalAddress

public long getLocalAddress()

bind

public void bind(long localAddr_,
                 int localPort_)

accept

public InetSocket accept(Port dataPort_)
                  throws java.io.IOException
Throws:
java.io.IOException

aAccept

public void aAccept(java.lang.Object msgID_)
             throws java.io.IOException
Asynchronized version of accept(). This call is nonblocking. The caller should call aAcceptFinished(SocketContract.Message, Port) to finish the accepting.

Throws:
java.io.IOException

aAcceptFinished

public InetSocket aAcceptFinished(SocketContract.Message reply_,
                                  Port dataPort_)
                           throws java.io.IOException
finishes an asynchronous "accept" when receiving an accept-reply.

Throws:
java.io.IOException

available

public int available()

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

aClose

public void aClose(java.lang.Object msgID_)
Asynchronized version of close(). This call is nonblocking. The caller should call aCloseFinished(SocketContract.Message) to finish the close.


aCloseFinished

public void aCloseFinished(SocketContract.Message reply_)
finishes an asynchronous "accept" when receiving an accept-reply.


connect

public void connect(long remoteAddress_,
                    int port_)
             throws java.io.IOException
Throws:
java.io.IOException

aConnect

public void aConnect(long remoteAddress_,
                     int port_,
                     java.lang.Object msgID_)
              throws java.io.IOException
Asynchronized version of connect(). This call is nonblocking. The caller should call aConnectFinished(SocketContract.Message) to finish the connecting.

Throws:
java.io.IOException

aConnectFinished

public void aConnectFinished(SocketContract.Message reply_)
                      throws java.io.IOException
finishes an asynchronous "connect" when receiving an connect-reply.

Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()

listen

public void listen(int backlog)

toString

public java.lang.String toString()

getOption

public java.lang.Object getOption(int optID)
Not implemented.


setOption

public void setOption(int optID,
                      java.lang.Object value)
Not implemented.


sendUrgentData

public void sendUrgentData(int data)
                    throws java.io.IOException
Not implemented.

Throws:
java.io.IOException

J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~