|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.io.SocketConnection
public class SocketConnection
This is a socket implementation of an Connection using the Apache
MINA framework. It uses a MINA IoSession to handle the
IO transport.
| Constructor Summary | |
|---|---|
SocketConnection(ConnectionListener listener,
CompleteMessageFilter filter,
org.apache.mina.common.IoSession session)
Construct a new SocketConnection with the given listener, filter, and session. |
|
| Method Summary | |
|---|---|
void |
close()
Asynchronously closes this connection, freeing any resources in use. |
void |
filteredMessageReceived(org.apache.mina.common.ByteBuffer buf)
Dispatches a complete message to this connection's ConnectionListener. |
(package private) ConnectionListener |
getConnectionListener()
Returns the ConnectionListener for this connection. |
(package private) CompleteMessageFilter |
getFilter()
Returns the IOFilter associated with this connection. |
void |
sendBytes(byte[] message)
Asynchronously sends data on this connection. |
void |
sendUnfiltered(org.apache.mina.common.ByteBuffer buf)
Sends the given MINA buffer out on the associated IoSession. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
SocketConnection(ConnectionListener listener,
CompleteMessageFilter filter,
org.apache.mina.common.IoSession session)
listener - the ConnectionListener for the
Connectionfilter - the CompleteMessageFilter for the
Connectionsession - the IoSession for the Connection| Method Detail |
|---|
public void sendBytes(byte[] message)
throws IOException
The specified byte array must not be modified after invoking this method; if the byte array is modified, then this method may have unpredictable results.
This implementation prepends the length of the given byte array as
a 4-byte int in network byte-order, and sends it out on
the underlying MINA IoSession.
sendBytes in interface Connectionmessage - the data to send
IOException - if the session is not connected
public void close()
throws IOException
disconnected is invoked
on the listener.
This implementation closes the underlying IoSession.
close in interface ConnectionIOException - if the session is not connectedpublic void filteredMessageReceived(org.apache.mina.common.ByteBuffer buf)
ConnectionListener.
filteredMessageReceived in interface FilterListenerbuf - a MINA ByteBuffer containing the message to dispatchpublic void sendUnfiltered(org.apache.mina.common.ByteBuffer buf)
IoSession.
sendUnfiltered in interface FilterListenerbuf - the MINA ByteBuffer to sendConnectionListener getConnectionListener()
ConnectionListener for this connection.
CompleteMessageFilter getFilter()
IOFilter associated with this connection.
|
Project Darkstar, Version 0.9.8.4 2013-07-29 20:28:05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||