public class AwidEndpoint extends java.lang.Object implements IPSessionEndpoint
Constructor and Description |
---|
AwidEndpoint(int timeout)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearUndeliveredMessages() |
void |
disconnect()
Reset the welcome message has been seen flag.
|
void |
handleMessage(ByteMessage message)
Called when a new message has been received.
|
boolean |
isConnected()
Return true if we have seen the welcome message
|
boolean |
isEmpty() |
ByteMessage |
receiveMessage()
Receive a message.
|
ByteMessage |
receiveMessage(int timeout)
Receive a message.
|
public AwidEndpoint(int timeout)
timeout
- the default amount of time to wait on responses in ms.public void handleMessage(ByteMessage message)
IPSessionEndpoint
handleMessage
in interface IPSessionEndpoint
message
- - the new message.public ByteMessage receiveMessage() throws java.io.IOException, java.util.concurrent.TimeoutException
java.io.IOException
java.util.concurrent.TimeoutException
- if the timeout has expired while waiting.public ByteMessage receiveMessage(int timeout) throws java.io.IOException, java.util.concurrent.TimeoutException
timeout
- the time to wait for a response in millisecondsjava.io.IOException
java.util.concurrent.TimeoutException
- if the timeout has expired while waiting.public boolean isConnected()
public void disconnect()
public void clearUndeliveredMessages()
public boolean isEmpty()