com.illposed.osc
Class OSCPortOut

java.lang.Object
  extended bycom.illposed.osc.OSCPort
      extended bycom.illposed.osc.OSCPortOut

public class OSCPortOut
extends OSCPort

OSCPortOut is the class that sends OSC messages to a specific address and port. To send an OSC message, call send().

An example based on com.illposed.osc.test.OSCPortTest::testMessageWithArgs() :

        OSCPort sender = new OSCPort();
        Object args[] = new Object[2];
        args[0] = new Integer(3);
        args[1] = "hello";
        OSCMessage msg = new OSCMessage("/sayhello", args);
         try {
                sender.send(msg);
         } catch (Exception e) {
                 showError("Couldn't send");
         }
 

Copyright (C) 2004-2006, C. Ramakrishnan / Illposed Software. All rights reserved.

See license.txt (or license.rtf) for license information.

Version:
1.0
Author:
Chandrasekhar Ramakrishnan

Field Summary
protected  java.net.InetAddress address
           
 
Fields inherited from class com.illposed.osc.OSCPort
port, socket
 
Constructor Summary
OSCPortOut()
          Create an OSCPort that sends to localhost, on the standard SuperCollider port Default the address to localhost Default the port to the standard one for SuperCollider
OSCPortOut(java.net.InetAddress newAddress)
          Create an OSCPort that sends to newAddress, on the standard SuperCollider port
OSCPortOut(java.net.InetAddress newAddress, int newPort)
          Create an OSCPort that sends to newAddress, newPort
 
Method Summary
 void send(OSCPacket aPacket)
          Send an osc packet (message or bundle) to the receiver I am bound to.
 
Methods inherited from class com.illposed.osc.OSCPort
close, defaultSCLangOSCPort, defaultSCOSCPort, finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

protected java.net.InetAddress address
Constructor Detail

OSCPortOut

public OSCPortOut(java.net.InetAddress newAddress,
                  int newPort)
           throws java.net.SocketException
Create an OSCPort that sends to newAddress, newPort

Parameters:
newAddress - InetAddress
newPort - int

OSCPortOut

public OSCPortOut(java.net.InetAddress newAddress)
           throws java.net.SocketException
Create an OSCPort that sends to newAddress, on the standard SuperCollider port

Parameters:
newAddress - InetAddress Default the port to the standard one for SuperCollider

OSCPortOut

public OSCPortOut()
           throws java.net.UnknownHostException,
                  java.net.SocketException
Create an OSCPort that sends to localhost, on the standard SuperCollider port Default the address to localhost Default the port to the standard one for SuperCollider

Method Detail

send

public void send(OSCPacket aPacket)
          throws java.io.IOException
Send an osc packet (message or bundle) to the receiver I am bound to.

Parameters:
aPacket - OSCPacket
Throws:
java.io.IOException