|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Socket
edu.emory.mathcs.util.net.inproc.InProcSocket
Abstraction of a socket accessible only within a process. While this
class fully adheres to the socket API, it is a socket that can only connect
to an appropriate "server socket"
within the same
process.
InProcServerSocket
Constructor Summary | |
InProcSocket()
Creates new, unconnected in-process socket. |
|
InProcSocket(int port)
Creates new in-process socket and connects it to a server socket listening on a specified port. |
Method Summary | |
void |
bind(java.net.SocketAddress bindpoint)
Not supported. |
void |
close()
|
void |
connect(java.net.SocketAddress endpoint,
int timeout)
Connects the socket to the in-proc server socket. |
java.net.InetAddress |
getInetAddress()
Returns a dummy "local" IP address of the form 127.0.0.129. |
java.io.InputStream |
getInputStream()
|
boolean |
getKeepAlive()
Returns true. |
java.net.InetAddress |
getLocalAddress()
Returns a dummy "local" IP address of the form 127.0.0.129. |
int |
getLocalPort()
Not meaningful. |
java.net.SocketAddress |
getLocalSocketAddress()
Returns an InProcSocketAddress holding local port number, as
obtained via getLocalPort() . |
boolean |
getOOBInline()
Returns false. |
java.io.OutputStream |
getOutputStream()
|
int |
getPort()
|
int |
getReceiveBufferSize()
|
java.net.SocketAddress |
getRemoteSocketAddress()
Returns server endpoint information as InProcSocketAddress . |
boolean |
getReuseAddress()
Returns true. |
int |
getSendBufferSize()
|
int |
getSoLinger()
Returns -1. |
int |
getSoTimeout()
|
boolean |
getTcpNoDelay()
Returns true. |
int |
getTrafficClass()
Returns 0. |
boolean |
isBound()
|
boolean |
isClosed()
|
boolean |
isConnected()
|
boolean |
isInputShutdown()
|
boolean |
isOutputShutdown()
|
void |
sendUrgentData(int data)
Unsupported. |
void |
setKeepAlive(boolean on)
Does nothing. |
void |
setOOBInline(boolean on)
Does nothing. |
void |
setReceiveBufferSize(int size)
|
void |
setReuseAddress(boolean on)
Does nothing. |
void |
setSendBufferSize(int size)
|
void |
setSoLinger(boolean on,
int linger)
Does nothing. |
void |
setSoTimeout(int timeout)
|
void |
setTcpNoDelay(boolean on)
Does nothing. |
void |
setTrafficClass(int tc)
Does nothing. |
void |
shutdownInput()
|
void |
shutdownOutput()
|
java.lang.String |
toString()
|
Methods inherited from class java.net.Socket |
connect, getChannel, setSocketImplFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InProcSocket(int port) throws java.io.IOException
port
- the port to connect to
java.io.IOException
- if I/O error occurspublic InProcSocket() throws java.net.SocketException
java.net.SocketException
- thrown by a superclass constructorMethod Detail |
public void connect(java.net.SocketAddress endpoint, int timeout) throws java.io.IOException
endpoint
must be an instance of
InProcSocketAddress
, that is, it must provide an in-proc port
number to connect to.
endpoint
- the in-proc endpoint to connect totimeout
- the timeout to wait for a connection to be established
java.io.IOException
- if an error occurs during the connection
java.net.SocketTimeoutException
- if timeout expires before connecting
java.lang.IllegalArgumentException
- if endpoint is not a
InProcSocketAddress instancepublic void bind(java.net.SocketAddress bindpoint) throws java.io.IOException
bindpoint
-
java.io.IOException
public java.net.InetAddress getInetAddress()
public java.net.InetAddress getLocalAddress()
public int getPort()
public int getLocalPort()
public java.net.SocketAddress getRemoteSocketAddress()
InProcSocketAddress
.
public java.net.SocketAddress getLocalSocketAddress()
InProcSocketAddress
holding local port number, as
obtained via getLocalPort()
.
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
public void setTcpNoDelay(boolean on) throws java.net.SocketException
java.net.SocketException
public boolean getTcpNoDelay() throws java.net.SocketException
java.net.SocketException
public void setSoLinger(boolean on, int linger) throws java.net.SocketException
java.net.SocketException
public int getSoLinger() throws java.net.SocketException
java.net.SocketException
public void sendUrgentData(int data) throws java.io.IOException
java.io.IOException
public void setOOBInline(boolean on) throws java.net.SocketException
java.net.SocketException
public boolean getOOBInline() throws java.net.SocketException
java.net.SocketException
public void setSoTimeout(int timeout) throws java.net.SocketException
java.net.SocketException
public int getSoTimeout() throws java.net.SocketException
java.net.SocketException
public void setSendBufferSize(int size) throws java.net.SocketException
java.net.SocketException
public int getSendBufferSize() throws java.net.SocketException
java.net.SocketException
public void setReceiveBufferSize(int size) throws java.net.SocketException
java.net.SocketException
public int getReceiveBufferSize() throws java.net.SocketException
java.net.SocketException
public void setKeepAlive(boolean on) throws java.net.SocketException
java.net.SocketException
public boolean getKeepAlive() throws java.net.SocketException
java.net.SocketException
public void setTrafficClass(int tc) throws java.net.SocketException
java.net.SocketException
public int getTrafficClass() throws java.net.SocketException
java.net.SocketException
public void setReuseAddress(boolean on) throws java.net.SocketException
java.net.SocketException
public boolean getReuseAddress() throws java.net.SocketException
java.net.SocketException
public void close() throws java.io.IOException
java.io.IOException
public void shutdownInput() throws java.io.IOException
java.io.IOException
public void shutdownOutput() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
public boolean isConnected()
public boolean isBound()
public boolean isClosed()
public boolean isInputShutdown()
public boolean isOutputShutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |