public class SocketEndPoint extends StreamEndPoint
Modifier | Constructor and Description |
---|---|
|
SocketEndPoint(Socket socket) |
protected |
SocketEndPoint(Socket socket,
int maxIdleTime) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close any backing stream associated with the endpoint
|
String |
getLocalAddr() |
String |
getLocalHost() |
int |
getLocalPort() |
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
Object |
getTransport() |
protected void |
idleExpired() |
boolean |
isInputShutdown() |
boolean |
isOpen() |
boolean |
isOutputShutdown() |
void |
setMaxIdleTime(int timeMs)
Set the max idle time.
|
void |
shutdownInput()
Shutdown any backing input stream associated with the endpoint
|
void |
shutdownOutput()
Shutdown any backing output stream associated with the endpoint
|
void |
shutdownSocketInput() |
protected void |
shutdownSocketOutput() |
String |
toString() |
blockReadable, blockWritable, fill, flush, flush, flush, getInputStream, getMaxIdleTime, getOutputStream, isBlocking, isClosed, setInputStream, setOutputStream
public SocketEndPoint(Socket socket) throws IOException
IOException
protected SocketEndPoint(Socket socket, int maxIdleTime) throws IOException
IOException
public boolean isOpen()
isOpen
in interface EndPoint
isOpen
in class StreamEndPoint
public boolean isInputShutdown()
isInputShutdown
in interface EndPoint
isInputShutdown
in class StreamEndPoint
public boolean isOutputShutdown()
isOutputShutdown
in interface EndPoint
isOutputShutdown
in class StreamEndPoint
protected final void shutdownSocketOutput() throws IOException
IOException
public void shutdownOutput() throws IOException
EndPoint
shutdownOutput
in interface EndPoint
shutdownOutput
in class StreamEndPoint
IOException
public void shutdownSocketInput() throws IOException
IOException
public void shutdownInput() throws IOException
EndPoint
shutdownInput
in interface EndPoint
shutdownInput
in class StreamEndPoint
IOException
public void close() throws IOException
EndPoint
close
in interface EndPoint
close
in class StreamEndPoint
IOException
public String getLocalAddr()
getLocalAddr
in interface EndPoint
getLocalAddr
in class StreamEndPoint
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.public String getLocalHost()
getLocalHost
in interface EndPoint
getLocalHost
in class StreamEndPoint
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.public int getLocalPort()
getLocalPort
in interface EndPoint
getLocalPort
in class StreamEndPoint
EndPoint
is listening, or 0
if this EndPoint
does not represent a network connection.public String getRemoteAddr()
getRemoteAddr
in interface EndPoint
getRemoteAddr
in class StreamEndPoint
EndPoint
is connected, or null
if this EndPoint
does not represent a network connection.public String getRemoteHost()
getRemoteHost
in interface EndPoint
getRemoteHost
in class StreamEndPoint
EndPoint
is connected, or null
if this EndPoint
does not represent a network connection.public int getRemotePort()
getRemotePort
in interface EndPoint
getRemotePort
in class StreamEndPoint
EndPoint
is connected, or 0
if this EndPoint
does not represent a network connection.public Object getTransport()
getTransport
in interface EndPoint
getTransport
in class StreamEndPoint
public void setMaxIdleTime(int timeMs) throws IOException
EndPoint
setMaxIdleTime
in interface EndPoint
setMaxIdleTime
in class StreamEndPoint
timeMs
- the max idle time in MS. Timeout <= 0 implies an infinite timeoutIOException
- if the timeout cannot be set.StreamEndPoint.setMaxIdleTime(int)
protected void idleExpired() throws IOException
idleExpired
in class StreamEndPoint
IOException
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.