public class InternalSocket extends Socket
| Constructor and Description |
|---|
InternalSocket(InputStream is,
OutputStream os)Server side |
InternalSocket(int port)Client side |
| Modifier and Type | Method and Description |
|---|---|
void | close()Close both streams. |
InputStream | getInputStream()Input stream connected to the internal server. |
int | getLocalPort()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
OutputStream | getOutputStream()Output stream connected to the internal server. |
int | getPort()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
static Socket | getSocket(String host,
int port)Convenience method to return either a Socket or an InternalSocket |
int | getSoLinger()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
int | getSoTimeout()Always returns 0, even if setSoTimeout() was called. |
boolean | isClosed()True if either stream is null. |
boolean | isConnected()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
boolean | isInputShutdown()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
boolean | isOutputShutdown()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
(package private) void | setInputStream(InputStream is)Input stream |
(package private) void | setOutputStream(OutputStream os)Output stream |
void | setSoLinger(boolean on,
int linger)Does nothing as of 0.9.33, prior to that threw UnsupportedOperationException |
void | setSoTimeout(int timeout)Supported as of 0.9.34, if constructed with TimeoutPipedInputStream
and TimeoutPipedOutputStream. |
void | shutdownInput()Supported as of 0.9.33, prior to that threw UnsupportedOperationException |
void | shutdownOutput()Flushes (as the Socket javadocs advise) and closes. |
String | toString()Descriptive label. |
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalSocketAddress, getOOBInline, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getTcpNoDelay, getTrafficClass, isBound, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setTcpNoDelay, setTrafficClassInternalSocket(InputStream is, OutputStream os)
public InternalSocket(int port)
throws IOExceptionport - > 0IOExceptionpublic void close()
public InputStream getInputStream()
getInputStream in class Socketpublic int getLocalPort()
getLocalPort in class Socketpublic OutputStream getOutputStream()
getOutputStream in class Socketpublic int getPort()
public static Socket getSocket(String host, int port) throws IOException
port - > 0IOExceptionpublic int getSoLinger()
getSoLinger in class Socketpublic int getSoTimeout()
getSoTimeout in class Socketpublic boolean isClosed()
public boolean isConnected()
isConnected in class Socketpublic boolean isInputShutdown()
isInputShutdown in class Socketpublic boolean isOutputShutdown()
isOutputShutdown in class Socketvoid setInputStream(InputStream is)
void setOutputStream(OutputStream os)
public void setSoLinger(boolean on,
int linger)setSoLinger in class Socketpublic void setSoTimeout(int timeout)
setSoTimeout in class SocketTimeoutPipedInputStreampublic void shutdownInput()
throws IOExceptionshutdownInput in class SocketIOExceptionpublic void shutdownOutput()
throws IOExceptionshutdownOutput in class SocketIOException