edu.nps.moves.disutil
Interface UdpServer.Listener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
UdpServer.Adapter
Enclosing class:
UdpServer

public static interface UdpServer.Listener
extends java.util.EventListener

An interface for listening to events from a UdpServer. A single UdpServer.Event is shared for all invocations of these methods.

This code is released into the Public Domain. Since this is Public Domain, you don't need to worry about licensing, and you can simply copy this UdpServer.java file to your own package and use it as you like. Enjoy. Please consider leaving the following statement here in this code:

This UdpServer class was copied to this project from its source as found at iHarder.net.

Version:
0.1
Author:
Robert Harder, rharder@users.sourceforge.net
See Also:
UdpServer, UdpServer.Adapter, UdpServer.Event

Method Summary
 void udpServerPacketReceived(UdpServer.Event evt)
          Called when a packet is received.
 void udpServerStateChanged(UdpServer.Event evt)
          Called when the state of the server has changed, such as "starting" or "stopped."
 

Method Detail

udpServerStateChanged

void udpServerStateChanged(UdpServer.Event evt)
Called when the state of the server has changed, such as "starting" or "stopped."

Parameters:
evt - the event
See Also:
UdpServer.State

udpServerPacketReceived

void udpServerPacketReceived(UdpServer.Event evt)
Called when a packet is received. This is called on the IO thread, so don't take too long, and if you want to offload the processing to another thread, be sure to copy the data out of the datagram since it will be clobbered the next time around.

Parameters:
evt - the event
See Also:
UdpServer.Event.getPacket()