|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.net.socket.SocketChannel
SocketChannel is an IChannel that represents a socket connection.
Constructor Summary | |
SocketChannel(java.net.Socket socket,
java.lang.String protocol)
|
|
SocketChannel(java.net.Socket socket,
java.lang.String protocol,
IChannelListener shutdownListener)
|
Method Summary | |
void |
close()
Close the channel. |
long |
getBytesRead()
Return the number of bytes read by this channel or -1 if the information is not collected |
long |
getBytesWritten()
Return the number of bytes written by this channel or -1 of the information is not collected |
static int |
getDefaultBufferSize()
|
static int |
getDefaultTimeout()
|
java.io.InputStream |
getInputStream()
Return the input stream. |
boolean |
getKeepAlive()
|
boolean |
getKeptAlive()
|
XURL |
getLocalXURL()
Return the URL of the local endpoint. |
java.io.OutputStream |
getOutputStream()
Return the output stream. |
XURL |
getRemoteXURL()
Return the URL of the remote endpoint. |
java.net.Socket |
getSocket()
Return the socket underlying this channel. |
int |
getState()
Return state of the channel. |
int |
getTimeout()
|
static void |
needInstrumentation(boolean instrumentChannel)
|
static void |
setDefaultBufferSize(int bufferSize)
|
static void |
setDefaultTimeout(int milliseconds)
|
void |
setKeepAlive(boolean keepAlive)
|
void |
setKeptAlive(boolean keptAlive)
|
void |
setState(int state)
Change the state of the channel. |
void |
setTimeout(int milliseconds)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SocketChannel(java.net.Socket socket, java.lang.String protocol) throws java.io.IOException
socket
- protocol
-
java.io.IOException
public SocketChannel(java.net.Socket socket, java.lang.String protocol, IChannelListener shutdownListener) throws java.io.IOException
socket
- protocol
- shutdownListener
-
java.io.IOException
Method Detail |
public java.lang.String toString()
public java.net.Socket getSocket()
WebServer
,
SSLMessageFactory
public void setTimeout(int milliseconds) throws java.io.IOException
milliseconds
- new socket timeout
java.io.IOException
public int getTimeout() throws java.io.IOException
java.io.IOException
- if socket closedpublic java.io.InputStream getInputStream() throws java.io.IOException
IChannel
getInputStream
in interface IChannel
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
IChannel
getOutputStream
in interface IChannel
java.io.IOException
public void close() throws java.io.IOException
IChannel
close
in interface IChannel
java.io.IOException
public XURL getLocalXURL()
IChannel
getLocalXURL
in interface IChannel
public XURL getRemoteXURL()
IChannel
getRemoteXURL
in interface IChannel
public long getBytesRead()
getBytesRead
in interface IChannel
public long getBytesWritten()
getBytesWritten
in interface IChannel
public void setKeepAlive(boolean keepAlive)
keepAlive
- public boolean getKeepAlive()
public void setKeptAlive(boolean keptAlive)
keptAlive
- public boolean getKeptAlive()
public static void setDefaultTimeout(int milliseconds)
milliseconds
- - the specified timeout in millisecondspublic static int getDefaultTimeout()
public static void setDefaultBufferSize(int bufferSize)
bufferSize
- public static int getDefaultBufferSize()
public int getState()
getState
in interface IChannel
public void setState(int state)
setState
in interface IChannel
state
- public static void needInstrumentation(boolean instrumentChannel)
instrumentChannel
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |