|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mpisws.p2p.transport.util.SocketWrapperSocket<Identifier,SubIdentifier>
Identifier
- SubIdentifier
- public class SocketWrapperSocket<Identifier,SubIdentifier>
Just maps a socket from one form into another.
Constructor Summary | |
---|---|
SocketWrapperSocket(Identifier identifier,
P2PSocket<SubIdentifier> socket,
Logger logger,
java.util.Map<java.lang.String,java.lang.Integer> options)
|
Method Summary | |
---|---|
void |
close()
Closes this socket. |
Identifier |
getIdentifier()
The identification of the node at the other end of the socket. |
java.util.Map<java.lang.String,java.lang.Integer> |
getOptions()
Details on the connectivity of the socket (encrypted, source-routed etc) |
long |
read(java.nio.ByteBuffer dsts)
Reads a sequence of bytes from this channel into a subsequence of the given buffer. |
long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length)
Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
void |
register(boolean wantToRead,
boolean wantToWrite,
P2PSocketReceiver<Identifier> receiver)
Must be called every time a Read/Write occurs to continue operation. |
void |
shutdownOutput()
Disables the output stream for this socket. |
java.lang.String |
toString()
|
long |
write(java.nio.ByteBuffer srcs)
Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SocketWrapperSocket(Identifier identifier, P2PSocket<SubIdentifier> socket, Logger logger, java.util.Map<java.lang.String,java.lang.Integer> options)
Method Detail |
---|
public Identifier getIdentifier()
P2PSocket
getIdentifier
in interface P2PSocket<Identifier>
public void close()
P2PSocket
close
in interface P2PSocket<Identifier>
public long read(java.nio.ByteBuffer dsts) throws java.io.IOException
P2PSocket
read
in interface P2PSocket<Identifier>
java.io.IOException
public long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
P2PSocket
read
in interface P2PSocket<Identifier>
java.io.IOException
public void register(boolean wantToRead, boolean wantToWrite, P2PSocketReceiver<Identifier> receiver)
P2PSocket
register
in interface P2PSocket<Identifier>
wantToRead
- if you want to read from this socketwantToWrite
- if you want to write to this socketreceiver
- will have receiveSelectResult() called on it
note that you must call select() each time receiveSelectResult() is called. This is so
your application can properly handle flow controlpublic void shutdownOutput()
P2PSocket
shutdownOutput
in interface P2PSocket<Identifier>
public long write(java.nio.ByteBuffer srcs) throws java.io.IOException
P2PSocket
write
in interface P2PSocket<Identifier>
java.io.IOException
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
write
in interface P2PSocket<Identifier>
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.Integer> getOptions()
P2PSocket
getOptions
in interface P2PSocket<Identifier>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |