de.sciss.net.test
Class NetUtilTest

java.lang.Object
  extended by de.sciss.net.test.NetUtilTest

public abstract class NetUtilTest
extends Object

Some static test run methods.

Since:
NetUtil 0.33
Version:
0.37, 12-May-09
Author:
Hanns Holger Rutz

Field Summary
protected static boolean pause
           
protected static boolean received
           
 
Method Summary
static void client(String protocol)
          Tests the client functionality on a given protocol.
static void codecSpeed()
          Tests the performance of OSCMessage encoding and decoding.
static void pingPong()
          Creates two receivers and two transmitters, one of each being restricted to loopback.
protected static void postln(String s)
           
static void server(String protocol)
          Tests the server functionality on a given protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pause

protected static boolean pause

received

protected static volatile boolean received
Method Detail

client

public static void client(String protocol)
Tests the client functionality on a given protocol. This assumes SuperCollider server (scsynth) is running on the local machine, listening at the given protocol and port 57110.

Parameters:
protocol - UDP or TCP

server

public static void server(String protocol)
Tests the server functionality on a given protocol. This opens a server listening at port 0x5454. Recognized messages are /pause, /quit, /dumpOSC. See NetUtil_Tests.rtf for a way to check the server.

Parameters:
protocol - UDP or TCP

codecSpeed

public static void codecSpeed()
Tests the performance of OSCMessage encoding and decoding. A cyclic random list of messages get decoded and encoded for five seconds, the number of codec operations during this interval is printed. Benchmarks for MacBook Pro 2.0 GHz, Mac OS X 10.4.8, 1.5.0_07: NetUtil 0.33 (build 07-May-07) vs. Illposed JavaOSC (20060402): encoding : NetUtil roughly 220% faster decoding : Illposed roughly 50% faster NetUtil 0.32 vs. 0.33 are very similar, decoding is a few percent faster in v0.33


pingPong

public static void pingPong()
Creates two receivers and two transmitters, one of each being restricted to loopback. Sends from each transmitter to each receiver. The expected result is that all messages arrive except those sent from the local host transmitter to loopback receiver (trns2 to rcv1, i.e. "five", "six").


postln

protected static void postln(String s)