Freenet
Class ConnectionHandler

java.lang.Object
java.lang.Thread
Freenet.ConnectionHandler
- All Implemented Interfaces:
- java.lang.Runnable
- public class ConnectionHandler
- extends java.lang.Thread
Handles both sending and receiving messages on a connection.
Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
ids
private static long ids
id
private long id
c
private Connection c
mh
private MessageHandler mh
pongs
private volatile java.lang.Long pongs
closed
private boolean closed
waiting
private boolean waiting
ConnectionHandler
public ConnectionHandler(Connection c,
MessageHandler mh)
run
public void run()
- Description copied from class:
java.lang.Thread
- The method of Thread that will be run if there is no Runnable object
associated with the Thread. Thread's implementation does nothing at all.
sendMessage
public void sendMessage(Message m)
throws SendFailedException
- Sends a message using this connection
sendMessage
public void sendMessage(Message m,
Freenet.support.SplitOutputStream datatunnel,
Freenet.support.ByteCounter count)
throws SendFailedException
- Sends a message using this connection
close
public void close()
forceClose
public void forceClose()
- forces this connection to close. Bad things will happen
if you use this carelessly.
isOpen
public boolean isOpen()
- Checks whether the connection is alive
peer
public Address peer()
peer
public Address peer(ListeningAddress laddr)
local
public Address local()
local
public Address local(ListeningAddress laddr)