netP5
Class AbstractUdpServer

java.lang.Object
  extended by netP5.AbstractUdpServer
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
UdpServer

public abstract class AbstractUdpServer
extends Object
implements Runnable


Constructor Summary
AbstractUdpServer(UdpPacketListener theListener, int thePort, int theBufferSize)
          create a new UdpServer
 
Method Summary
 void dispose()
          stop the UDP server, clean up and delete its reference.
 void run()
           
 void send(byte[] theBytes)
          send a byte array to a previously defined remoteAddress.
 void send(byte[] theBytes, InetAddress theAddress, int thePort)
          send a byte array to a dedicated remoteAddress.
 void send(byte[] theBytes, String theAddress, int thePort)
          send a byte array to a dedicated remoteAddress.
 void send(DatagramPacket thePacket)
           
 DatagramSocket socket()
          get the datagram socket of the UDP server.
 void start()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUdpServer

public AbstractUdpServer(UdpPacketListener theListener,
                         int thePort,
                         int theBufferSize)
create a new UdpServer

Parameters:
theListener - UdpPacketListener
thePort - int
theBufferSize - int
Method Detail

socket

public DatagramSocket socket()
get the datagram socket of the UDP server.

Returns:
DatagramSocket

start

public void start()

run

public void run()
Specified by:
run in interface Runnable

dispose

public void dispose()
stop the UDP server, clean up and delete its reference.


send

public void send(byte[] theBytes)
send a byte array to a previously defined remoteAddress.

Parameters:
theBytes - byte[]

send

public void send(byte[] theBytes,
                 String theAddress,
                 int thePort)
send a byte array to a dedicated remoteAddress.

Parameters:
thePacket - OscPacket
theAddress - String
thePort - int

send

public void send(DatagramPacket thePacket)
Parameters:
thePacket - DatagramPacket

send

public void send(byte[] theBytes,
                 InetAddress theAddress,
                 int thePort)
send a byte array to a dedicated remoteAddress.

Parameters:
theBytes - byte[]
theAddress - InetAddress
thePort - int


processing library oscP5 by Andreas Schlegel. (c) 2004-2012