|
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
|
+--seda.sandStorm.core.SimpleSink
|
+--seda.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 seda.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 seda.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
SimpleSinkenqueue in class SimpleSinkseda.sandStorm.api.SinkIFelement - 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)
SimpleSinkenqueue_lossy in class SimpleSinkseda.sandStorm.api.SinkIFelement - The QueueElementIF to enqueue
public void enqueue_many(QueueElementIF[] elements)
throws SinkException
SimpleSinkenqueue_many in class SimpleSinkseda.sandStorm.api.SinkIFelements - 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()
SimpleSinksize 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
SimpleSinkenqueue_prepare in class SimpleSinkseda.sandStorm.api.SinkIFelements - 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_abortpublic void enqueue_commit(java.lang.Object key)
SimpleSinkenqueue_commit in class SimpleSinkseda.sandStorm.api.SinkIFkey - 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)
SimpleSinkenqueue_abort in class SimpleSinkseda.sandStorm.api.SinkIFkey - 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 | ||||||||