public static class UdpServer.Event
extends java.util.EventObject
UdpServer
.
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.
UdpServer
,
UdpServer.Adapter
,
UdpServer.Listener
,
Serialized FormConstructor and Description |
---|
Event(UdpServer src)
Creates a Event based on the given
UdpServer . |
Modifier and Type | Method and Description |
---|---|
java.net.DatagramPacket |
getPacket()
Returns the most recent datagram packet received
by the
UdpServer . |
byte[] |
getPacketAsBytes()
Copies and returns the bytes in the most recently
received packet, or null if not available.
|
java.lang.String |
getPacketAsString()
Returns the data in the most recently-received
packet as if it were a String
or null if not available.
|
UdpServer.State |
getState()
Shorthand for getUdpServer().getState().
|
UdpServer |
getUdpServer()
Returns the source of the event, a
UdpServer . |
public UdpServer getUdpServer()
UdpServer
.
Shorthand for (UdpServer)getSource().public UdpServer.State getState()
UdpServer.State
public java.net.DatagramPacket getPacket()
UdpServer
. Shorthand for
getUdpServer().getPacket().public byte[] getPacketAsBytes()
public java.lang.String getPacketAsString()