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)
NodeConnectionServerListener
newNodeConnection
in interface NodeConnectionServerListener
public void newMessageReceived(NodeConnection remoteCon, Message message)
NodeConnectionListener
newMessageReceived
in interface NodeConnectionListener
remoteCon
- the RemoteConnection which the event happenedmessage
- the message just receivedpublic void connected(NodeConnection remoteCon)
NodeConnectionListener
connected
in interface NodeConnectionListener
remoteCon
- the RemoteConnection which the event happenedpublic void reconnected(NodeConnection remoteCon, java.net.SocketAddress endPoint, boolean wasHandover, boolean wasMandatory)
NodeConnectionListener
reconnected
in interface NodeConnectionListener
remoteCon
- 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)
NodeConnectionListener
disconnected
in interface NodeConnectionListener
remoteCon
- the RemoteConnection which the event happenedpublic void unsentMessages(NodeConnection remoteCon, java.util.List<Message> unsentMessages)
NodeConnectionListener
unsentMessages
in interface NodeConnectionListener
remoteCon
- the Remote Connection related with the eventunsentMessages
- a list with all unsent messagespublic void internalException(NodeConnection remoteCon, java.lang.Exception e)
NodeConnectionListener
internalException
in interface NodeConnectionListener
remoteCon
- the RemoteConnection relatede
- the Exception