front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java
changeset 9 0f44b7360c8d
parent 0 6fefd4afe506
child 10 925b7ee746e3
--- a/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java	Thu Mar 22 16:00:17 2012 +0100
+++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java	Thu Mar 22 18:15:53 2012 +0100
@@ -1,4 +1,4 @@
-/**
+/**
  * @author cramakrishnan
  *
  * Copyright (C) 2004, C. Ramakrishnan / Illposed Software
@@ -15,16 +15,16 @@
  * When you want 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");
-		 }
+        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");
+         }
  */
 
 package com.illposed.osc;
@@ -35,45 +35,45 @@
 
 public class OSCPortOut extends OSCPort {
 
-	protected InetAddress address;
+    protected InetAddress address;
 
-	/**
-	 * Create an OSCPort that sends to newAddress, newPort
-	 * @param newAddress InetAddress
-	 * @param newPort int
-	 */
-	public OSCPortOut(InetAddress newAddress, int newPort) throws SocketException {
-		socket = new DatagramSocket();
-		address = newAddress;
-		port = newPort;
-	}
+    /**
+     * Create an OSCPort that sends to newAddress, newPort
+     * @param newAddress InetAddress
+     * @param newPort int
+     */
+    public OSCPortOut(InetAddress newAddress, int newPort) throws SocketException {
+        socket = new DatagramSocket();
+        address = newAddress;
+        port = newPort;
+    }
 
-	/**
-	 * Create an OSCPort that sends to newAddress, on the standard SuperCollider port
-	 * @param newAddress InetAddress
-	 *
-	 * Default the port to the standard one for SuperCollider
-	 */
-	public OSCPortOut(InetAddress newAddress) throws SocketException {
-		this(newAddress, defaultSCOSCPort);
-	}
+    /**
+     * Create an OSCPort that sends to newAddress, on the standard SuperCollider port
+     * @param newAddress InetAddress
+     *
+     * Default the port to the standard one for SuperCollider
+     */
+    public OSCPortOut(InetAddress newAddress) throws SocketException {
+        this(newAddress, defaultSCOSCPort);
+    }
 
-	/**
-	 * 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
-	 */
-	public OSCPortOut() throws UnknownHostException, SocketException {
-		this(InetAddress.getLocalHost(), defaultSCOSCPort);
-	}
-	
-	/**
-	 * @param aPacket OSCPacket
-	 */
-	public void send(OSCPacket aPacket) throws IOException {
-		byte[] byteArray = aPacket.getByteArray();
-		DatagramPacket packet = 
-			new DatagramPacket(byteArray, byteArray.length,address,port);
-		socket.send(packet);
-	}
+    /**
+     * 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
+     */
+    public OSCPortOut() throws UnknownHostException, SocketException {
+        this(InetAddress.getLocalHost(), defaultSCOSCPort);
+    }
+    
+    /**
+     * @param aPacket OSCPacket
+     */
+    public void send(OSCPacket aPacket) throws IOException {
+        byte[] byteArray = aPacket.getByteArray();
+        DatagramPacket packet = 
+            new DatagramPacket(byteArray, byteArray.length,address,port);
+        socket.send(packet);
+    }
 }