|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activeio.net.SocketStreamChannel
public class SocketStreamChannel
A StreamChannel implementation that uses a Socket
to talk to the network.
| Field Summary |
|---|
| Fields inherited from interface org.activeio.Service |
|---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Fields inherited from interface org.activeio.Service |
|---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Constructor Summary | |
|---|---|
protected |
SocketStreamChannel(Socket socket)
|
| Method Summary | |
|---|---|
int |
available()
|
void |
dispose()
This method should not throw any exceptions. |
void |
flush()
Some channels may buffer data which may be sent down if flush() is called. |
InetAddress |
getInetAddress()
|
boolean |
getKeepAlive()
|
InetAddress |
getLocalAddress()
|
int |
getLocalPort()
|
SocketAddress |
getLocalSocketAddress()
|
boolean |
getOOBInline()
|
int |
getPort()
|
int |
getReceiveBufferSize()
|
SocketAddress |
getRemoteSocketAddress()
|
boolean |
getReuseAddress()
|
int |
getSendBufferSize()
|
Socket |
getSocket()
|
int |
getSoLinger()
|
int |
getSoTimeout()
|
boolean |
getTcpNoDelay()
|
int |
getTrafficClass()
|
boolean |
isBound()
|
boolean |
isClosed()
|
boolean |
isConnected()
|
void |
mark(int pos)
|
boolean |
markSupported()
|
Object |
narrow(Class target)
Since a Channel may be composed from a chain of other Channel obejcts, this method allows you to query the chain for the specified interface. |
int |
read()
|
int |
read(byte[] data)
|
int |
read(byte[] data,
int offset,
int length)
|
void |
reset()
|
void |
setKeepAlive(boolean on)
|
void |
setOOBInline(boolean on)
|
void |
setReceiveBufferSize(int size)
|
void |
setReuseAddress(boolean on)
|
void |
setSendBufferSize(int size)
|
void |
setSoLinger(boolean on,
int linger)
|
protected void |
setSoTimeout(int i)
|
void |
setTcpNoDelay(boolean on)
|
void |
setTrafficClass(int tc)
|
long |
skip(long count)
|
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
String |
toString()
|
void |
write(byte[] data)
|
void |
write(byte[] data,
int pos,
int length)
|
void |
write(int data)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected SocketStreamChannel(Socket socket)
throws IOException
IOException| Method Detail |
|---|
protected void setSoTimeout(int i)
throws SocketException
SocketException
public void flush()
throws IOException
OutputStreamChannel
flush in interface OutputStreamChannelIOExceptionorg.activeio.Channel#flush()public void dispose()
Disposable
dispose in interface DisposableDisposable.dispose()
public void start()
throws IOException
Service
start in interface ServiceIOException
public void stop(long timeout)
throws IOException
Service
stop in interface Servicetimeout - The amount of time the channel is allowed to take to gracefully stop. If the timeout
is exceeded, the channel should do a forcefull stop.
IOExceptionpublic InetAddress getInetAddress()
getInetAddress in interface SocketMetadata
public boolean getKeepAlive()
throws SocketException
getKeepAlive in interface SocketMetadataSocketExceptionpublic InetAddress getLocalAddress()
getLocalAddress in interface SocketMetadatapublic int getLocalPort()
getLocalPort in interface SocketMetadatapublic SocketAddress getLocalSocketAddress()
getLocalSocketAddress in interface SocketMetadata
public boolean getOOBInline()
throws SocketException
getOOBInline in interface SocketMetadataSocketExceptionpublic int getPort()
getPort in interface SocketMetadata
public int getReceiveBufferSize()
throws SocketException
getReceiveBufferSize in interface SocketMetadataSocketExceptionpublic SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in interface SocketMetadata
public boolean getReuseAddress()
throws SocketException
getReuseAddress in interface SocketMetadataSocketException
public int getSendBufferSize()
throws SocketException
getSendBufferSize in interface SocketMetadataSocketException
public int getSoLinger()
throws SocketException
getSoLinger in interface SocketMetadataSocketException
public int getSoTimeout()
throws SocketException
getSoTimeout in interface SocketMetadataSocketException
public boolean getTcpNoDelay()
throws SocketException
getTcpNoDelay in interface SocketMetadataSocketException
public int getTrafficClass()
throws SocketException
getTrafficClass in interface SocketMetadataSocketExceptionpublic boolean isBound()
isBound in interface SocketMetadatapublic boolean isClosed()
isClosed in interface SocketMetadatapublic boolean isConnected()
isConnected in interface SocketMetadata
public void setKeepAlive(boolean on)
throws SocketException
setKeepAlive in interface SocketMetadataSocketException
public void setOOBInline(boolean on)
throws SocketException
setOOBInline in interface SocketMetadataSocketException
public void setReceiveBufferSize(int size)
throws SocketException
setReceiveBufferSize in interface SocketMetadataSocketException
public void setReuseAddress(boolean on)
throws SocketException
setReuseAddress in interface SocketMetadataSocketException
public void setSendBufferSize(int size)
throws SocketException
setSendBufferSize in interface SocketMetadataSocketException
public void setSoLinger(boolean on,
int linger)
throws SocketException
setSoLinger in interface SocketMetadataSocketException
public void setTcpNoDelay(boolean on)
throws SocketException
setTcpNoDelay in interface SocketMetadataSocketException
public void setTrafficClass(int tc)
throws SocketException
setTrafficClass in interface SocketMetadataSocketExceptionpublic Object narrow(Class target)
Channel
narrow in interface Channelpublic String toString()
toString in class Object
public void write(byte[] data,
int pos,
int length)
throws IOException
write in interface OutputStreamChannelIOException
public void write(byte[] data)
throws IOException
write in interface OutputStreamChannelIOException
public void write(int data)
throws IOException
write in interface OutputStreamChannelIOException
public int available()
throws IOException
available in interface InputStreamChannelIOExceptionpublic void mark(int pos)
mark in interface InputStreamChannelpublic boolean markSupported()
markSupported in interface InputStreamChannel
public int read(byte[] data,
int offset,
int length)
throws IOException
read in interface InputStreamChannelIOException
public int read(byte[] data)
throws IOException
read in interface InputStreamChannelIOException
public void reset()
throws IOException
reset in interface InputStreamChannelIOException
public long skip(long count)
throws IOException
skip in interface InputStreamChannelIOException
public int read()
throws IOException
read in interface InputStreamChannelIOExceptionpublic Socket getSocket()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||