public class DProtocol extends Object implements Runnable
Modifier and Type | Class and Description |
---|---|
static class |
DProtocol.ListenerIndex |
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG_CONNECT_PORT |
static int |
DEBUG_PORT |
Constructor and Description |
---|
DProtocol(BufferedInputStream in,
BufferedOutputStream out) |
DProtocol(BufferedInputStream in,
BufferedOutputStream out,
Socket s,
boolean detectBrokenSocket) |
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(DProtocol.ListenerIndex index,
DProtocolNotifierIF n)
Allow outside entities to listen for incoming DMessages.
|
boolean |
bind()
Create and start up a thread for our receiving messages.
|
Exception |
getDisconnectCause() |
DMessageCounter |
getMessageCounter() |
long |
messagesReceived() |
long |
messagesSent() |
void |
run()
Entry point for our receive thread
|
boolean |
unbind()
Shutdown our receive thread
|
public static final int DEBUG_PORT
public static final int DEBUG_CONNECT_PORT
public DProtocol(BufferedInputStream in, BufferedOutputStream out)
public DProtocol(BufferedInputStream in, BufferedOutputStream out, Socket s, boolean detectBrokenSocket)
public boolean addListener(DProtocol.ListenerIndex index, DProtocolNotifierIF n)
index
- the index of this listener. Listeners have a strictly defined
order.n
- the listenerpublic long messagesReceived()
public long messagesSent()
public boolean bind()
public boolean unbind()
public DMessageCounter getMessageCounter()
public Exception getDisconnectCause()
Copyright © 2016 The Apache Software Foundation. All rights reserved.