| java.lang.Object seda.sandStorm.lib.Gnutella.GnutellaServer
GnutellaServer | public class GnutellaServer implements EventHandlerIF,GnutellaConst(Code) | | A GnutellaServer is a SandStorm stage which allows outgoing connections
to be established to the Gnutella network, and accepts incoming
connections. The server has a client sink associated with it, onto which
GnutellaConnection and GnutellaPacket events are pushed.
When a connection is closed, a SinkClosedEvent is pushed, with the
sink pointer set to the GnutellaConnection that closed. If a an
outgoing connection fails, a GnutellaConnectFailedevent is pushed.
author: Matt Welsh (mdw@cs.berkeley.edu) See Also: GnutellaConnection, GnutellaPacket |
Inner Class :class connectionState | |
Constructor Summary | |
public | GnutellaServer(ManagerIF mgr, SinkIF clientSink) Create a Gnutella server listening for incoming connections on
the default port of 6346. | public | GnutellaServer(ManagerIF mgr, SinkIF clientSink, int listenPort) Create a Gnutella server listening for incoming connections on
the given listenPort. |
GnutellaServer | public GnutellaServer(ManagerIF mgr, SinkIF clientSink) throws Exception(Code) | | Create a Gnutella server listening for incoming connections on
the default port of 6346.
|
GnutellaServer | public GnutellaServer(ManagerIF mgr, SinkIF clientSink, int listenPort) throws Exception(Code) | | Create a Gnutella server listening for incoming connections on
the given listenPort. If listenPort == 0, no incoming connections
will be accepted. (Outgoing connections can still be established
using openConnection.)
|
destroy | public void destroy()(Code) | | |
openConnection | public void openConnection(String hostname, int port) throws UnknownHostException(Code) | | Open a connection to the given hostname and port. When the
connection is established, a GnutellaConnection will be pushed to
this server's client sink.
|
openConnection | public void openConnection(InetAddress address, int port)(Code) | | Open a connection to the given address and port. When the
connection is established, a GnutellaConnection will be pushed to
this server's client sink.
|
registerSink | public void registerSink(SinkIF sink)(Code) | | Register a sink to receive incoming packets on this
connection.
|
|
|