public class HelloWorldServer extends java.lang.Object implements NodeConnectionServerListener, NodeConnectionListener
| Modifier and Type | Field and Description |
|---|---|
MrUdpNodeConnectionServer |
server |
| Constructor and Description |
|---|
HelloWorldServer(int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
connected(NodeConnection remoteCon)
Called when the connection is stabilished.
|
void |
disconnected(NodeConnection remoteCon)
Called when the connection is lost.
|
void |
internalException(NodeConnection remoteCon,
java.lang.Exception e)
Called when a internal exception occurs in the RemoteConnection
implementation.
|
static void |
main(java.lang.String[] args) |
void |
newMessageReceived(NodeConnection remoteCon,
Message message)
Called when the Gateway sends a object.
|
void |
newNodeConnection(NodeConnection remoteCon)
Called when a new connection is made.
|
void |
reconnected(NodeConnection remoteCon,
java.net.SocketAddress endPoint,
boolean wasHandover,
boolean wasMandatory)
Method called to inform that the connection was broken but made again.
|
void |
unsentMessages(NodeConnection remoteCon,
java.util.List<Message> unsentMessages)
Called when connection drops and there is unacked sent messages.
|
public MrUdpNodeConnectionServer server
public static void main(java.lang.String[] args)
public void newNodeConnection(NodeConnection remoteCon)
NodeConnectionServerListenernewNodeConnection in interface NodeConnectionServerListenerpublic void newMessageReceived(NodeConnection remoteCon, Message message)
NodeConnectionListenernewMessageReceived in interface NodeConnectionListenerremoteCon - the RemoteConnection which the event happenedmessage - the message just receivedpublic void connected(NodeConnection remoteCon)
NodeConnectionListenerconnected in interface NodeConnectionListenerremoteCon - the RemoteConnection which the event happenedpublic void reconnected(NodeConnection remoteCon, java.net.SocketAddress endPoint, boolean wasHandover, boolean wasMandatory)
NodeConnectionListenerreconnected in interface NodeConnectionListenerremoteCon - the related remote connectionendPoint - the end point connectedwasHandover - if a handover was made, ie. if the current end point is
the different than the lastwasMandatory - is it was a mandatory handoverpublic void disconnected(NodeConnection remoteCon)
NodeConnectionListenerdisconnected in interface NodeConnectionListenerremoteCon - the RemoteConnection which the event happenedpublic void unsentMessages(NodeConnection remoteCon, java.util.List<Message> unsentMessages)
NodeConnectionListenerunsentMessages in interface NodeConnectionListenerremoteCon - the Remote Connection related with the eventunsentMessages - a list with all unsent messagespublic void internalException(NodeConnection remoteCon, java.lang.Exception e)
NodeConnectionListenerinternalException in interface NodeConnectionListenerremoteCon - the RemoteConnection relatede - the Exception