wt.util
Class WrappedSocket

java.lang.Object
  extended byjava.net.Socket
      extended bywt.util.WrappedSocket

public class WrappedSocket
extends Socket


Nested Class Summary
(package private)  class WrappedSocket.Input
           
(package private)  class WrappedSocket.Output
           
(package private) static class WrappedSocket.SocketCache
           
 
Field Summary
private static long bytesIn
           
private static long bytesOut
           
private  boolean closed
           
private  int inBufSize
           
private  InputStream inputStream
           
private static int numSockets
           
private  int outBufSize
           
private  OutputStream outputStream
           
private  Socket socket
           
private static Cache socketCache
           
static boolean VERBOSE_CLOSE
           
static boolean VERBOSE_IO
           
 
Fields inherited from class java.net.Socket
 
Constructor Summary
WrappedSocket(Socket this_socket, int in_buf_size, int out_buf_size)
           
 
Method Summary
private  void active(WrappedSocket wrapped_socket)
           
private  void activeIn(WrappedSocket wrapped_socket, int bytes_in)
           
private  void activeOut(WrappedSocket wrapped_socket, int bytes_out)
           
 void close()
           
private static void decrementNumSockets()
           
protected  void finalize()
           
static long getBytesIn()
           
static long getBytesOut()
           
 InetAddress getInetAddress()
           
 InputStream getInputStream()
           
 boolean getKeepAlive()
           
 InetAddress getLocalAddress()
           
 int getLocalPort()
           
static int getNumSockets()
           
 OutputStream getOutputStream()
           
 int getPort()
           
 int getReceiveBufferSize()
           
 boolean getReuseAddress()
           
 int getSendBufferSize()
           
 int getSoLinger()
           
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 int getTrafficClass()
           
private static void incrementNumSockets()
           
 void setKeepAlive(boolean on)
           
static void setMaxSockets(int max_sockets)
           
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSendBufferSize(int size)
           
 void setSoLinger(boolean on, int val)
           
 void setSoTimeout(int timeout)
           
 void setTcpNoDelay(boolean on)
           
 void setTrafficClass(int tc)
           
 String toString()
           
 
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setSocketImplFactory, shutdownInput, shutdownOutput
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERBOSE_CLOSE

public static boolean VERBOSE_CLOSE

VERBOSE_IO

public static boolean VERBOSE_IO

socketCache

private static Cache socketCache

numSockets

private static int numSockets

bytesIn

private static long bytesIn

bytesOut

private static long bytesOut

inBufSize

private int inBufSize

outBufSize

private int outBufSize

socket

private Socket socket

inputStream

private InputStream inputStream

outputStream

private OutputStream outputStream

closed

private boolean closed
Constructor Detail

WrappedSocket

public WrappedSocket(Socket this_socket,
                     int in_buf_size,
                     int out_buf_size)
              throws SocketException
Method Detail

incrementNumSockets

private static void incrementNumSockets()

decrementNumSockets

private static void decrementNumSockets()

getNumSockets

public static int getNumSockets()

getBytesIn

public static long getBytesIn()

getBytesOut

public static long getBytesOut()

setMaxSockets

public static void setMaxSockets(int max_sockets)

active

private void active(WrappedSocket wrapped_socket)

activeIn

private void activeIn(WrappedSocket wrapped_socket,
                      int bytes_in)

activeOut

private void activeOut(WrappedSocket wrapped_socket,
                       int bytes_out)

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable

getInputStream

public InputStream getInputStream()
                           throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Throws:
IOException

getInetAddress

public InetAddress getInetAddress()

getLocalAddress

public InetAddress getLocalAddress()

getPort

public int getPort()

getLocalPort

public int getLocalPort()

setTcpNoDelay

public void setTcpNoDelay(boolean on)
                   throws SocketException
Throws:
SocketException

getTcpNoDelay

public boolean getTcpNoDelay()
                      throws SocketException
Throws:
SocketException

setSoLinger

public void setSoLinger(boolean on,
                        int val)
                 throws SocketException
Throws:
SocketException

getSoLinger

public int getSoLinger()
                throws SocketException
Throws:
SocketException

setSoTimeout

public void setSoTimeout(int timeout)
                  throws SocketException
Throws:
SocketException

getSoTimeout

public int getSoTimeout()
                 throws SocketException
Throws:
SocketException

setSendBufferSize

public void setSendBufferSize(int size)
                       throws SocketException
Throws:
SocketException

getSendBufferSize

public int getSendBufferSize()
                      throws SocketException
Throws:
SocketException

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws SocketException
Throws:
SocketException

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws SocketException
Throws:
SocketException

setKeepAlive

public void setKeepAlive(boolean on)
                  throws SocketException
Throws:
SocketException

getKeepAlive

public boolean getKeepAlive()
                     throws SocketException
Throws:
SocketException

setTrafficClass

public void setTrafficClass(int tc)
                     throws SocketException
Throws:
SocketException

getTrafficClass

public int getTrafficClass()
                    throws SocketException
Throws:
SocketException

setReuseAddress

public void setReuseAddress(boolean on)
                     throws SocketException
Throws:
SocketException

getReuseAddress

public boolean getReuseAddress()
                        throws SocketException
Throws:
SocketException

close

public void close()
           throws IOException
Throws:
IOException

toString

public String toString()