public class UDPListener
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
fBytesIn |
int |
fBytesOut |
IncomingUDPServerPacket |
fLastIncomingPacket |
OutgoingUDPServerPacket |
fLastOutgoingPacket |
java.net.DatagramSocket |
fSocket |
| Constructor and Description |
|---|
UDPListener(ExtasysUDPServer myUDPServer,
java.lang.String name,
java.net.InetAddress ipAddress,
int port,
int readBufferSize,
int readDataTimeOut)
Constructs a new UDP Listener.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBytesIn() |
int |
getBytesOut() |
java.net.InetAddress |
getIPAddress()
Returns the IP address of this UDP Listener.
|
ExtasysUDPServer |
getMyExtasysUDPServer()
Returns the main Extasys UDP Server of this UDP listener.
|
java.lang.String |
getName()
Returns the name of this UDP Listener.
|
int |
getPort()
Returns the UDP port of this listener.
|
int |
getReadBufferSize()
Returns the read buffer size of this listener.
|
boolean |
isActive()
Returns the active state of this listener.
|
void |
SendData(java.net.DatagramPacket packet)
Send data to udp client.
|
void |
Start()
Start or restart the UDP listener.
|
void |
Stop()
Stop the UDP listener.
|
public java.net.DatagramSocket fSocket
public int fBytesIn
public int fBytesOut
public IncomingUDPServerPacket fLastIncomingPacket
public OutgoingUDPServerPacket fLastOutgoingPacket
public UDPListener(ExtasysUDPServer myUDPServer, java.lang.String name, java.net.InetAddress ipAddress, int port, int readBufferSize, int readDataTimeOut)
myUDPServer - is the udp listener's main UDP server.name - is the name of the listener.ipAddress - is the listener's IP address.port - is the listener's UDP port.readBufferSize - is the read buffer size of the listener.readDataTimeOut - is the maximum time in milliseconds in wich a datagram packet can be received. Set to 0 for no time-out.public void Start()
throws java.net.SocketException
java.net.SocketExceptionpublic void Stop()
public void SendData(java.net.DatagramPacket packet)
packet - is the datagram packet to be send.public ExtasysUDPServer getMyExtasysUDPServer()
public java.lang.String getName()
public java.net.InetAddress getIPAddress()
public int getPort()
public int getReadBufferSize()
public int getBytesIn()
public int getBytesOut()
public boolean isActive()