net.i2p.util
Class InternalSocket

java.lang.Object
  extended by java.net.Socket
      extended by net.i2p.util.InternalSocket

public class InternalSocket
extends java.net.Socket

A simple in-JVM Socket using Piped Streams. We use port numbers just like regular sockets. Can only connect to InternalServerSocket.

Since:
0.7.9

Constructor Summary
InternalSocket(java.io.InputStream is, java.io.OutputStream os)
          server side
InternalSocket(int port)
          client side
 
Method Summary
 void bind(java.net.SocketAddress endpoint)
          Deprecated. unsupported
 void close()
           
 void connect(java.net.SocketAddress endpoint)
          Deprecated. unsupported
 void connect(java.net.SocketAddress endpoint, int timeout)
          Deprecated. unsupported
 java.nio.channels.SocketChannel getChannel()
          Deprecated. unsupported
 java.net.InetAddress getInetAddress()
          Deprecated. unsupported
 java.io.InputStream getInputStream()
           
 boolean getKeepAlive()
          Deprecated. unsupported
 java.net.InetAddress getLocalAddress()
          Deprecated. unsupported
 int getLocalPort()
          Deprecated. unsupported
 java.net.SocketAddress getLocalSocketAddress()
          Deprecated. unsupported
 boolean getOOBInline()
          Deprecated. unsupported
 java.io.OutputStream getOutputStream()
           
 int getPort()
          Deprecated. unsupported
 int getReceiveBufferSize()
          Deprecated. unsupported
 java.net.SocketAddress getRemoteSocketAddress()
          Deprecated. unsupported
 boolean getReuseAddress()
          Deprecated. unsupported
 int getSendBufferSize()
          Deprecated. unsupported
static java.net.Socket getSocket(java.lang.String host, int port)
          Convenience method to return either a Socket or an InternalSocket
 int getSoLinger()
          Deprecated. unsupported
 int getSoTimeout()
           
 boolean getTcpNoDelay()
          Deprecated. unsupported
 int getTrafficClass()
          Deprecated. unsupported
 boolean isBound()
          Deprecated. unsupported
 boolean isClosed()
           
 boolean isConnected()
          Deprecated. unsupported
 boolean isInputShutdown()
          Deprecated. unsupported
 boolean isOutputShutdown()
          Deprecated. unsupported
 void sendUrgentData(int data)
          Deprecated. unsupported
(package private)  void setInputStream(java.io.InputStream is)
           
 void setKeepAlive(boolean on)
          Deprecated. unsupported
 void setOOBInline(boolean on)
          Deprecated. unsupported
(package private)  void setOutputStream(java.io.OutputStream os)
           
 void setReceiveBufferSize(int size)
          Deprecated. unsupported
 void setReuseAddress(boolean on)
          Deprecated. unsupported
 void setSendBufferSize(int size)
          Deprecated. unsupported
 void setSoLinger(boolean on, int linger)
          Deprecated. unsupported
 void setSoTimeout(int timeout)
          warning - unsupported
 void setTcpNoDelay(boolean on)
          Deprecated. unsupported
 void setTrafficClass(int cize)
          Deprecated. unsupported
 void shutdownInput()
          Deprecated. unsupported
 void shutdownOutput()
          Deprecated. unsupported
 java.lang.String toString()
           
 
Methods inherited from class java.net.Socket
setPerformancePreferences, setSocketImplFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InternalSocket

InternalSocket(java.io.InputStream is,
               java.io.OutputStream os)
server side


InternalSocket

public InternalSocket(int port)
               throws java.io.IOException
client side

Throws:
java.io.IOException
Method Detail

getSocket

public static java.net.Socket getSocket(java.lang.String host,
                                        int port)
                                 throws java.io.IOException
Convenience method to return either a Socket or an InternalSocket

Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
Overrides:
getInputStream in class java.net.Socket

getOutputStream

public java.io.OutputStream getOutputStream()
Overrides:
getOutputStream in class java.net.Socket

setInputStream

void setInputStream(java.io.InputStream is)

setOutputStream

void setOutputStream(java.io.OutputStream os)

close

public void close()
Overrides:
close in class java.net.Socket

isClosed

public boolean isClosed()
Overrides:
isClosed in class java.net.Socket

toString

public java.lang.String toString()
Overrides:
toString in class java.net.Socket

setSoTimeout

public void setSoTimeout(int timeout)
warning - unsupported

Overrides:
setSoTimeout in class java.net.Socket

getSoTimeout

public int getSoTimeout()
Overrides:
getSoTimeout in class java.net.Socket

bind

public void bind(java.net.SocketAddress endpoint)
Deprecated. unsupported

Overrides:
bind in class java.net.Socket

connect

public void connect(java.net.SocketAddress endpoint)
Deprecated. unsupported

Overrides:
connect in class java.net.Socket

connect

public void connect(java.net.SocketAddress endpoint,
                    int timeout)
Deprecated. unsupported

Overrides:
connect in class java.net.Socket

getChannel

public java.nio.channels.SocketChannel getChannel()
Deprecated. unsupported

Overrides:
getChannel in class java.net.Socket

getInetAddress

public java.net.InetAddress getInetAddress()
Deprecated. unsupported

Overrides:
getInetAddress in class java.net.Socket

getKeepAlive

public boolean getKeepAlive()
Deprecated. unsupported

Overrides:
getKeepAlive in class java.net.Socket

getLocalAddress

public java.net.InetAddress getLocalAddress()
Deprecated. unsupported

Overrides:
getLocalAddress in class java.net.Socket

getLocalPort

public int getLocalPort()
Deprecated. unsupported

Overrides:
getLocalPort in class java.net.Socket

getLocalSocketAddress

public java.net.SocketAddress getLocalSocketAddress()
Deprecated. unsupported

Overrides:
getLocalSocketAddress in class java.net.Socket

getOOBInline

public boolean getOOBInline()
Deprecated. unsupported

Overrides:
getOOBInline in class java.net.Socket

getPort

public int getPort()
Deprecated. unsupported

Overrides:
getPort in class java.net.Socket

getReceiveBufferSize

public int getReceiveBufferSize()
Deprecated. unsupported

Overrides:
getReceiveBufferSize in class java.net.Socket

getRemoteSocketAddress

public java.net.SocketAddress getRemoteSocketAddress()
Deprecated. unsupported

Overrides:
getRemoteSocketAddress in class java.net.Socket

getReuseAddress

public boolean getReuseAddress()
Deprecated. unsupported

Overrides:
getReuseAddress in class java.net.Socket

getSendBufferSize

public int getSendBufferSize()
Deprecated. unsupported

Overrides:
getSendBufferSize in class java.net.Socket

getSoLinger

public int getSoLinger()
Deprecated. unsupported

Overrides:
getSoLinger in class java.net.Socket

getTcpNoDelay

public boolean getTcpNoDelay()
Deprecated. unsupported

Overrides:
getTcpNoDelay in class java.net.Socket

getTrafficClass

public int getTrafficClass()
Deprecated. unsupported

Overrides:
getTrafficClass in class java.net.Socket

isBound

public boolean isBound()
Deprecated. unsupported

Overrides:
isBound in class java.net.Socket

isConnected

public boolean isConnected()
Deprecated. unsupported

Overrides:
isConnected in class java.net.Socket

isInputShutdown

public boolean isInputShutdown()
Deprecated. unsupported

Overrides:
isInputShutdown in class java.net.Socket

isOutputShutdown

public boolean isOutputShutdown()
Deprecated. unsupported

Overrides:
isOutputShutdown in class java.net.Socket

sendUrgentData

public void sendUrgentData(int data)
Deprecated. unsupported

Overrides:
sendUrgentData in class java.net.Socket

setKeepAlive

public void setKeepAlive(boolean on)
Deprecated. unsupported

Overrides:
setKeepAlive in class java.net.Socket

setOOBInline

public void setOOBInline(boolean on)
Deprecated. unsupported

Overrides:
setOOBInline in class java.net.Socket

setReceiveBufferSize

public void setReceiveBufferSize(int size)
Deprecated. unsupported

Overrides:
setReceiveBufferSize in class java.net.Socket

setReuseAddress

public void setReuseAddress(boolean on)
Deprecated. unsupported

Overrides:
setReuseAddress in class java.net.Socket

setSendBufferSize

public void setSendBufferSize(int size)
Deprecated. unsupported

Overrides:
setSendBufferSize in class java.net.Socket

setSoLinger

public void setSoLinger(boolean on,
                        int linger)
Deprecated. unsupported

Overrides:
setSoLinger in class java.net.Socket

setTcpNoDelay

public void setTcpNoDelay(boolean on)
Deprecated. unsupported

Overrides:
setTcpNoDelay in class java.net.Socket

setTrafficClass

public void setTrafficClass(int cize)
Deprecated. unsupported

Overrides:
setTrafficClass in class java.net.Socket

shutdownInput

public void shutdownInput()
Deprecated. unsupported

Overrides:
shutdownInput in class java.net.Socket

shutdownOutput

public void shutdownOutput()
Deprecated. unsupported

Overrides:
shutdownOutput in class java.net.Socket