|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mdw.sandStorm.core.SimpleSink | +--mdw.sandStorm.lib.Gnutella.GnutellaConnection
A GnutellaConnection represents a virtual connection to the Gnutella network. It may implement a single point-to-point connection between two peers, or a one-to-many connection to multiple peers.
Fields inherited from interface mdw.sandStorm.lib.Gnutella.GnutellaConst |
DEFAULT_DOWNLOAD_PORT, DEFAULT_GNUTELLA_PORT, DEFAULT_HOPS, DEFAULT_PING_INTERVAL, DEFAULT_SPEED, DEFAULT_TTL, GNUTELLA_CONNECT, GNUTELLA_FN_PING, GNUTELLA_FN_PONG, GNUTELLA_FN_PUSH, GNUTELLA_FN_QUERY, GNUTELLA_FN_QUERYHITS, GNUTELLA_OK, MAX_PAYLOAD_SIZE, PACKET_HEADER_SIZE, WRITE_CLOG_THRESHOLD |
Constructor Summary | |
(package private) |
GnutellaConnection(GnutellaServer gs,
ATcpConnection conn)
|
Method Summary | |
void |
close(SinkIF compQ)
|
void |
enqueue_abort(java.lang.Object key)
Not supported; throws an IllegalArgumentException. |
void |
enqueue_commit(java.lang.Object key)
Not supported; throws an IllegalArgumentException. |
boolean |
enqueue_lossy(QueueElementIF element)
Calls enqueue() and returns false if SinkException occurs. |
void |
enqueue_many(QueueElementIF[] elements)
Simply calls enqueue() on each item in the array. |
java.lang.Object |
enqueue_prepare(QueueElementIF[] enqueueMe)
Not supported; throws an IllegalArgumentException. |
void |
enqueue(QueueElementIF element)
Must be implemented by subclasses. |
void |
flush(SinkIF compQ)
|
java.net.InetAddress |
getAddress()
Return the InetAddress of the peer. |
(package private) ATcpConnection |
getConnection()
|
int |
getPort()
Return the port of the peer. |
(package private) GnutellaPacketReader |
getReader()
|
void |
sendPing()
Send a ping to this connection. |
void |
sendPing(int ttl)
Send a ping to this connection with the given TTL. |
int |
size()
Returns 0. |
java.lang.String |
toString()
|
Methods inherited from class mdw.sandStorm.core.SimpleSink |
getEnqueuePredicate, profileSize, setEnqueuePredicate |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
GnutellaConnection(GnutellaServer gs, ATcpConnection conn)
Method Detail |
public java.net.InetAddress getAddress()
public int getPort()
public void sendPing()
public void sendPing(int ttl)
ATcpConnection getConnection()
GnutellaPacketReader getReader()
public void enqueue(QueueElementIF element) throws SinkException
SimpleSink
enqueue
in class SimpleSink
mdw.sandStorm.api.SinkIF
element
- The QueueElementIF
to enqueueSinkFullException
- Indicates that the sink is temporarily full.SinkClosedException
- Indicates that the sink is
no longer being serviced.public boolean enqueue_lossy(QueueElementIF element)
SimpleSink
enqueue_lossy
in class SimpleSink
mdw.sandStorm.api.SinkIF
element
- The QueueElementIF
to enqueuepublic void enqueue_many(QueueElementIF[] elements) throws SinkException
SimpleSink
enqueue_many
in class SimpleSink
mdw.sandStorm.api.SinkIF
elements
- The element array to enqueueSinkFullException
- Indicates that the sink is temporarily full.SinkClosedException
- Indicates that the sink is
no longer being serviced.public int size()
SimpleSink
size
in class SimpleSink
public void close(SinkIF compQ) throws SinkClosedException
public void flush(SinkIF compQ) throws SinkClosedException
public java.lang.Object enqueue_prepare(QueueElementIF[] enqueueMe) throws SinkException
SimpleSink
enqueue_prepare
in class SimpleSink
mdw.sandStorm.api.SinkIF
elements
- The element array to provisionally enqueueSinkFullException
- Indicates that the sink is temporarily full
and that the requested elements could not be provisionally enqueued.SinkClosedException
- Indicates that the sink is
no longer being serviced.enqueue_commit
,
enqueue_abort
public void enqueue_commit(java.lang.Object key)
SimpleSink
enqueue_commit
in class SimpleSink
mdw.sandStorm.api.SinkIF
key
- The enqueue key returned by a previous call to
enqueue_prepare().java.lang.IllegalArgumentException
- Thrown if an unknown enqueue key
is provided.public void enqueue_abort(java.lang.Object key)
SimpleSink
enqueue_abort
in class SimpleSink
mdw.sandStorm.api.SinkIF
key
- The enqueue key returned by a previous call to
enqueue_prepare().java.lang.IllegalArgumentException
- Thrown if an unknown enqueue key
is provided.public java.lang.String toString()
toString
in class java.lang.Object
|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |