netP5
Class UdpServer
java.lang.Object
netP5.AbstractUdpServer
netP5.UdpServer
- All Implemented Interfaces:
- Runnable, UdpPacketListener
public class UdpServer
- extends AbstractUdpServer
- implements UdpPacketListener
- Author:
- andreas schlegel
UdpServer
public UdpServer(Object theObject,
int thePort,
int theBufferSize)
- new UDP server.
by default the buffersize of a udp packet is 1536 bytes. you can set
your own individual buffersize with the third parameter int in the constructor.
- Parameters:
theObject
- ObjectthePort
- inttheBufferSize
- int
UdpServer
public UdpServer(Object theObject,
int thePort)
UdpServer
public UdpServer(UdpPacketListener theListener,
int thePort,
int theBufferSize)
- Parameters:
theListener
- thePort
- theBufferSize
-
process
public void process(DatagramPacket thePacket,
int thePort)
- Specified by:
process
in interface UdpPacketListener
- Parameters:
thePacket
- DatagramPacketthePort
- int
addListener
public void addListener(NetListener theListener)
- add a listener to the udp server. each incoming packet will be forwarded
to the listener.
- Parameters:
theListener
-
removeListener
public void removeListener(NetListener theListener)
- Parameters:
theListener
-
getListener
public NetListener getListener(int theIndex)
- Parameters:
theIndex
-
- Returns:
getListeners
public Vector getListeners()
- Returns:
processing library oscP5 by Andreas Schlegel. (c) 2004-2012