|
||||||||||
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 OutputStreamChannel
IOException
org.activeio.Channel#flush()
public void dispose()
Disposable
dispose
in interface Disposable
Disposable.dispose()
public void start() throws IOException
Service
start
in interface Service
IOException
public void stop(long timeout) throws IOException
Service
stop
in interface Service
timeout
- 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.
IOException
public InetAddress getInetAddress()
getInetAddress
in interface SocketMetadata
public boolean getKeepAlive() throws SocketException
getKeepAlive
in interface SocketMetadata
SocketException
public InetAddress getLocalAddress()
getLocalAddress
in interface SocketMetadata
public int getLocalPort()
getLocalPort
in interface SocketMetadata
public SocketAddress getLocalSocketAddress()
getLocalSocketAddress
in interface SocketMetadata
public boolean getOOBInline() throws SocketException
getOOBInline
in interface SocketMetadata
SocketException
public int getPort()
getPort
in interface SocketMetadata
public int getReceiveBufferSize() throws SocketException
getReceiveBufferSize
in interface SocketMetadata
SocketException
public SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in interface SocketMetadata
public boolean getReuseAddress() throws SocketException
getReuseAddress
in interface SocketMetadata
SocketException
public int getSendBufferSize() throws SocketException
getSendBufferSize
in interface SocketMetadata
SocketException
public int getSoLinger() throws SocketException
getSoLinger
in interface SocketMetadata
SocketException
public int getSoTimeout() throws SocketException
getSoTimeout
in interface SocketMetadata
SocketException
public boolean getTcpNoDelay() throws SocketException
getTcpNoDelay
in interface SocketMetadata
SocketException
public int getTrafficClass() throws SocketException
getTrafficClass
in interface SocketMetadata
SocketException
public boolean isBound()
isBound
in interface SocketMetadata
public boolean isClosed()
isClosed
in interface SocketMetadata
public boolean isConnected()
isConnected
in interface SocketMetadata
public void setKeepAlive(boolean on) throws SocketException
setKeepAlive
in interface SocketMetadata
SocketException
public void setOOBInline(boolean on) throws SocketException
setOOBInline
in interface SocketMetadata
SocketException
public void setReceiveBufferSize(int size) throws SocketException
setReceiveBufferSize
in interface SocketMetadata
SocketException
public void setReuseAddress(boolean on) throws SocketException
setReuseAddress
in interface SocketMetadata
SocketException
public void setSendBufferSize(int size) throws SocketException
setSendBufferSize
in interface SocketMetadata
SocketException
public void setSoLinger(boolean on, int linger) throws SocketException
setSoLinger
in interface SocketMetadata
SocketException
public void setTcpNoDelay(boolean on) throws SocketException
setTcpNoDelay
in interface SocketMetadata
SocketException
public void setTrafficClass(int tc) throws SocketException
setTrafficClass
in interface SocketMetadata
SocketException
public Object narrow(Class target)
Channel
narrow
in interface Channel
public String toString()
toString
in class Object
public void write(byte[] data, int pos, int length) throws IOException
write
in interface OutputStreamChannel
IOException
public void write(byte[] data) throws IOException
write
in interface OutputStreamChannel
IOException
public void write(int data) throws IOException
write
in interface OutputStreamChannel
IOException
public int available() throws IOException
available
in interface InputStreamChannel
IOException
public void mark(int pos)
mark
in interface InputStreamChannel
public boolean markSupported()
markSupported
in interface InputStreamChannel
public int read(byte[] data, int offset, int length) throws IOException
read
in interface InputStreamChannel
IOException
public int read(byte[] data) throws IOException
read
in interface InputStreamChannel
IOException
public void reset() throws IOException
reset
in interface InputStreamChannel
IOException
public long skip(long count) throws IOException
skip
in interface InputStreamChannel
IOException
public int read() throws IOException
read
in interface InputStreamChannel
IOException
public Socket getSocket()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |