|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectseda.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.
Field Summary |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 interface SinkIF
enqueue
in class SimpleSink
SinkException
public boolean enqueue_lossy(QueueElementIF element)
SimpleSink
enqueue_lossy
in interface SinkIF
enqueue_lossy
in class SimpleSink
public void enqueue_many(QueueElementIF[] elements) throws SinkException
SimpleSink
enqueue_many
in interface SinkIF
enqueue_many
in class SimpleSink
SinkException
public int size()
SimpleSink
size
in interface SinkIF
size
in class SimpleSink
public void close(SinkIF compQ) throws SinkClosedException
SinkClosedException
public void flush(SinkIF compQ) throws SinkClosedException
SinkClosedException
public java.lang.Object enqueue_prepare(QueueElementIF[] enqueueMe) throws SinkException
SimpleSink
enqueue_prepare
in interface SinkIF
enqueue_prepare
in class SimpleSink
SinkException
public void enqueue_commit(java.lang.Object key)
SimpleSink
enqueue_commit
in interface SinkIF
enqueue_commit
in class SimpleSink
public void enqueue_abort(java.lang.Object key)
SimpleSink
enqueue_abort
in interface SinkIF
enqueue_abort
in class SimpleSink
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |