| Package | org.tuio.connectors |
| Class | public class UDPConnector |
| Inheritance | UDPConnector Object |
| Implements | IOSCConnector |
IOSCConnector using UDP.
This connector only works in Adobe AIR since v2 due to it using the DatagramSocket
This connector can be used to send an receive OSC bundles and messages.
Though you have to create seperate instances of the connector.
| Method | Defined By | ||
|---|---|---|---|
UDPConnector(host:String = 127.0.0.1, port:int = 3333, bind:Boolean = true) | UDPConnector | ||
addListener(listener:IOSCConnectorListener):void
Adds a listener for incoming data to a private list. | UDPConnector | ||
close():void
Closes the connector
| UDPConnector | ||
removeListener(listener:IOSCConnectorListener):void
Removes a listener for incoming data to a private list. | UDPConnector | ||
sendOSCPacket(oscPacket:OSCPacket):void
Sends an OSCPacket via the connection type implemented by this IOSCConnector. | UDPConnector | ||
| UDPConnector | () | Constructor |
public function UDPConnector(host:String = 127.0.0.1, port:int = 3333, bind:Boolean = true)Parameters
host:String (default = 127.0.0.1) — ip of the tracker resp. tuio message producer.
| |
port:int (default = 3333) — of the tracker resp. tuio message producer.
| |
bind:Boolean (default = true) — If true the UDPConnector will try to bind the given IP:port and to receive packets. If false the UDPConnector connects to the given IP:port and will wait for calls of UDPConnector.sendOSCPacket()
|
//tracker runs on localhost on default port 3333
var tuio:TuioClient = new TuioClient(new UDPConnector());
//or
//tracker runs on 192.0.0.5 on default port 3333
var tuio:TuioClient = new TuioClient(new UDPConnector("192.0.0.5"));
//or
//tracker runs on 192.0.0.5 on port 3334
var tuio:TuioClient = new TuioClient(new UDPConnector("192.0.0.5",3334));
| addListener | () | method |
public function addListener(listener:IOSCConnectorListener):voidAdds a listener for incoming data to a private list.
Parameters
listener:IOSCConnectorListener — A listener for incoming data
|
| close | () | method |
public function close():voidCloses the connector
| removeListener | () | method |
public function removeListener(listener:IOSCConnectorListener):voidRemoves a listener for incoming data to a private list.
Parameters
listener:IOSCConnectorListener — A listener for incoming data
|
| sendOSCPacket | () | method |
public function sendOSCPacket(oscPacket:OSCPacket):voidSends an OSCPacket via the connection type implemented by this IOSCConnector.
Parameters
oscPacket:OSCPacket — The OSCPacket to be sent via this connection.
|