jist.swans.app.net
Class Socket

java.lang.Object
  extended by jist.swans.app.net.Socket

public class Socket
extends java.lang.Object

The SWANS target of all java.net.Socket calls.

Since:
SWANS1.0
Version:
$Id: Socket.java,v 1.7 2004/04/06 16:07:47 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu&rt;

Field Summary
private  SocketInterface.TcpSocketInterface socketEntity
          supporting socket entity.
 
Constructor Summary
  Socket()
           
  Socket(java.net.InetAddress address, int port)
           
  Socket(java.net.InetAddress host, int port, boolean stream)
           
  Socket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort)
           
protected Socket(java.net.SocketImpl impl)
           
  Socket(java.lang.String host, int port)
           
  Socket(java.lang.String host, int port, boolean stream)
           
  Socket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort)
           
  Socket(TcpSocket socket)
           
 
Method Summary
 void _jistPostInit()
          Method call after socket initialization.
 void bind(java.net.SocketAddress bindpoint)
           
 void close()
           
 void connect(java.net.SocketAddress endpoint)
           
 void connect(java.net.SocketAddress endpoint, int timeout)
           
 java.nio.channels.SocketChannel getChannel()
           
 java.net.InetAddress getInetAddress()
           
 InputStream getInputStream()
           
 boolean getKeepAlive()
           
 java.net.InetAddress getLocalAddress()
           
 int getLocalPort()
           
 java.net.SocketAddress getLocalSocketAddress()
           
 boolean getOOBInline()
           
 OutputStream getOutputStream()
           
 int getPort()
           
 int getReceiveBufferSize()
           
 java.net.SocketAddress getRemoteSocketAddress()
           
 boolean getReuseAddress()
           
 int getSendBufferSize()
           
 int getSoLinger()
           
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 int getTrafficClass()
           
 boolean isBound()
           
 boolean isClosed()
           
 boolean isConnected()
           
 boolean isInputShutdown()
           
 boolean isOutputShutdown()
           
 void sendUrgentData(int data)
           
 void setKeepAlive(boolean on)
           
 void setOOBInline(boolean on)
           
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSendBufferSize(int size)
           
static void setSocketImplFactory(java.net.SocketImplFactory fac)
           
 void setSoLinger(boolean on, int linger)
           
 void setSoTimeout(int timeout)
           
 void setTcpNoDelay(boolean on)
           
 void setTrafficClass(int tc)
           
 void shutdownInput()
           
 void shutdownOutput()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

socketEntity

private SocketInterface.TcpSocketInterface socketEntity
supporting socket entity.

Constructor Detail

Socket

public Socket()
See Also:
Socket

Socket

public Socket(java.net.InetAddress address,
              int port)
See Also:
Socket

Socket

public Socket(java.net.InetAddress host,
              int port,
              boolean stream)
See Also:
Socket

Socket

public Socket(java.net.InetAddress address,
              int port,
              java.net.InetAddress localAddr,
              int localPort)
See Also:
Socket

Socket

protected Socket(java.net.SocketImpl impl)
See Also:
Socket

Socket

public Socket(java.lang.String host,
              int port)
See Also:
Socket

Socket

public Socket(java.lang.String host,
              int port,
              boolean stream)
See Also:
Socket

Socket

public Socket(java.lang.String host,
              int port,
              java.net.InetAddress localAddr,
              int localPort)
See Also:
Socket

Socket

public Socket(TcpSocket socket)
See Also:
Socket
Method Detail

_jistPostInit

public void _jistPostInit()
Method call after socket initialization. Since constructors can not be blocking, we performing blocking events in this method, which is called immediately after the constructor.


bind

public void bind(java.net.SocketAddress bindpoint)
See Also:
Socket

close

public void close()
See Also:
Socket

connect

public void connect(java.net.SocketAddress endpoint)
See Also:
Socket

connect

public void connect(java.net.SocketAddress endpoint,
                    int timeout)
See Also:
Socket

getChannel

public java.nio.channels.SocketChannel getChannel()
See Also:
Socket

getInetAddress

public java.net.InetAddress getInetAddress()
See Also:
Socket

getInputStream

public InputStream getInputStream()
See Also:
Socket

getKeepAlive

public boolean getKeepAlive()
See Also:
Socket

getLocalAddress

public java.net.InetAddress getLocalAddress()
See Also:
Socket

getLocalPort

public int getLocalPort()
See Also:
Socket

getLocalSocketAddress

public java.net.SocketAddress getLocalSocketAddress()
See Also:
Socket

getOOBInline

public boolean getOOBInline()
See Also:
Socket

getOutputStream

public OutputStream getOutputStream()
See Also:
Socket

getPort

public int getPort()
See Also:
Socket

getReceiveBufferSize

public int getReceiveBufferSize()
See Also:
Socket

getRemoteSocketAddress

public java.net.SocketAddress getRemoteSocketAddress()
See Also:
Socket

getReuseAddress

public boolean getReuseAddress()
See Also:
Socket

getSendBufferSize

public int getSendBufferSize()
See Also:
Socket

getSoLinger

public int getSoLinger()
See Also:
Socket

getSoTimeout

public int getSoTimeout()
See Also:
Socket

getTcpNoDelay

public boolean getTcpNoDelay()
See Also:
Socket

getTrafficClass

public int getTrafficClass()
See Also:
Socket

isBound

public boolean isBound()
See Also:
Socket

isClosed

public boolean isClosed()
See Also:
Socket

isConnected

public boolean isConnected()
See Also:
Socket

isInputShutdown

public boolean isInputShutdown()
See Also:
Socket

isOutputShutdown

public boolean isOutputShutdown()
See Also:
Socket

sendUrgentData

public void sendUrgentData(int data)
See Also:
Socket

setKeepAlive

public void setKeepAlive(boolean on)
See Also:
Socket

setOOBInline

public void setOOBInline(boolean on)
See Also:
Socket

setReceiveBufferSize

public void setReceiveBufferSize(int size)
See Also:
Socket

setReuseAddress

public void setReuseAddress(boolean on)
See Also:
Socket

setSendBufferSize

public void setSendBufferSize(int size)
See Also:
Socket

setSocketImplFactory

public static void setSocketImplFactory(java.net.SocketImplFactory fac)
See Also:
Socket

setSoLinger

public void setSoLinger(boolean on,
                        int linger)
See Also:
Socket

setSoTimeout

public void setSoTimeout(int timeout)
See Also:
Socket

setTcpNoDelay

public void setTcpNoDelay(boolean on)
See Also:
Socket

setTrafficClass

public void setTrafficClass(int tc)
See Also:
Socket

shutdownInput

public void shutdownInput()
                   throws java.io.IOException
Throws:
java.io.IOException
See Also:
Socket

shutdownOutput

public void shutdownOutput()
                    throws java.io.IOException
Throws:
java.io.IOException
See Also:
Socket

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Socket