|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.tomp2p.connection.ConnectionHandler
public class ConnectionHandler
Handles the server connections of a node, i.e. the connections a node is listening on.
Field Summary | |
---|---|
static String |
THREAD_NAME
|
static int |
UDP_LIMIT
|
Constructor Summary | |
---|---|
ConnectionHandler(ConnectionHandler parent,
Number160 id,
KeyPair keyPair,
PeerMap peerMap)
Attaches a peer to an existing connection and use existing information. |
|
ConnectionHandler(int udpPort,
int tcpPort,
Number160 id,
Bindings bindings,
int p2pID,
ConnectionConfiguration configuration,
File messageLogger,
KeyPair keyPair,
PeerMap peerMap,
org.jboss.netty.util.Timer timer,
int maxMessageSize,
int maintenanceThreads,
int replicationThreads,
int workerThreads)
|
Method Summary | |
---|---|
void |
customLoggerMessage(String customMessage)
Writes a custom message to the logger filter. |
ConnectionBean |
getConnectionBean()
|
NATUtils |
getNATUtils()
|
PeerBean |
getPeerBean()
|
boolean |
isListening()
|
void |
shutdown()
Shuts down the dispatcher and frees resources. |
boolean |
startupTCP(InetSocketAddress listenAddressesTCP,
DispatcherReply dispatcher,
int maxMessageSize)
Creates TCP channels and listens on them |
boolean |
startupUDP(InetSocketAddress listenAddressesUDP,
DispatcherReply dispatcher)
Creates UDP channels and listens on them |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String THREAD_NAME
public static final int UDP_LIMIT
Constructor Detail |
---|
public ConnectionHandler(int udpPort, int tcpPort, Number160 id, Bindings bindings, int p2pID, ConnectionConfiguration configuration, File messageLogger, KeyPair keyPair, PeerMap peerMap, org.jboss.netty.util.Timer timer, int maxMessageSize, int maintenanceThreads, int replicationThreads, int workerThreads) throws IOException
udpPort
- tcpPort
- id
- bindings
- p2pID
- configuration
- messageLogger
- keyPair
- peerMap
- listeners
- peerConfiguration
-
Exception
IOException
public ConnectionHandler(ConnectionHandler parent, Number160 id, KeyPair keyPair, PeerMap peerMap)
parent
- The parent handlerid
- The id of the child peerkeyPair
- The keypair of the child peerpeerMap
- The peer map of the child peerMethod Detail |
---|
public ConnectionBean getConnectionBean()
public PeerBean getPeerBean()
public NATUtils getNATUtils()
public boolean startupUDP(InetSocketAddress listenAddressesUDP, DispatcherReply dispatcher)
listenAddressesUDP
- The address to listen todispatcher
- The dispatcher that handles incoming messages
public boolean startupTCP(InetSocketAddress listenAddressesTCP, DispatcherReply dispatcher, int maxMessageSize)
listenAddressesTCP
- the addresses which we will listen ondispatcher
- The dispatcher that handles incoming messagesmaxMessageSize
- The maximum message size that is tolerated
public void customLoggerMessage(String customMessage)
customMessage
- The custom message to print.public void shutdown()
public boolean isListening()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |