|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.peerreview.replay.playback.ReplaySocket<Identifier>
public class ReplaySocket<Identifier>
Field Summary | |
---|---|
protected Identifier |
identifier
|
protected int |
socketId
|
protected ReplayVerifier<Identifier> |
verifier
|
Constructor Summary | |
---|---|
ReplaySocket(Identifier identifier,
int socketId,
ReplayVerifier<Identifier> verifier,
java.util.Map<java.lang.String,java.lang.Object> options)
TODO: Make extensible by putting into a factory. |
Method Summary | |
---|---|
boolean |
cancel()
|
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.Object> |
getOptions()
Details on the connectivity of the socket (encrypted, source-routed etc) |
void |
notifyIO(boolean canRead,
boolean canWrite)
|
long |
read(java.nio.ByteBuffer dst)
Reads a sequence of bytes from this channel into a subsequence of the given buffer. |
void |
receiveException(java.io.IOException ioe)
|
void |
register(boolean wantToRead,
boolean wantToWrite,
P2PSocketReceiver<Identifier> receiver)
Must be called every time a Read/Write occurs to continue operation. |
void |
setDeliverSocketToMe(SocketCallback<Identifier> deliverSocketToMe)
|
void |
shutdownOutput()
Disables the output stream for this socket. |
void |
socketOpened()
|
long |
write(java.nio.ByteBuffer src)
Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Identifier identifier
protected int socketId
protected ReplayVerifier<Identifier> verifier
Constructor Detail |
---|
public ReplaySocket(Identifier identifier, int socketId, ReplayVerifier<Identifier> verifier, java.util.Map<java.lang.String,java.lang.Object> options)
identifier
- socketId
- verifier
- Method Detail |
---|
public Identifier getIdentifier()
P2PSocket
getIdentifier
in interface P2PSocket<Identifier>
getIdentifier
in interface SocketRequestHandle<Identifier>
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
P2PSocket
getOptions
in interface P2PSocket<Identifier>
getOptions
in interface SocketRequestHandle<Identifier>
public long read(java.nio.ByteBuffer dst) throws java.io.IOException
P2PSocket
read
in interface P2PSocket<Identifier>
java.io.IOException
public long write(java.nio.ByteBuffer src) throws java.io.IOException
P2PSocket
write
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 notifyIO(boolean canRead, boolean canWrite) throws java.io.IOException
java.io.IOException
public void close()
P2PSocket
close
in interface P2PSocket<Identifier>
public void setDeliverSocketToMe(SocketCallback<Identifier> deliverSocketToMe)
public void socketOpened()
public void shutdownOutput()
P2PSocket
shutdownOutput
in interface P2PSocket<Identifier>
public void receiveException(java.io.IOException ioe)
public boolean cancel()
cancel
in interface Cancellable
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |