Examples of OscServer


Examples of com.neophob.sematrix.osc.server.impl.OscServer

    final String msgName = "/PILLEPALLE";
    final String msgNameTwo = "/PILLEPALLE-TWO";
    final String msgName3 = "/PILLEPALLE-3";
    final String param = "param234";
   
    OscServer srv1 = OscServerFactory.createServer(this, 8888, 4096);
    srv1.startServer();

    OscMessage msg = new OscMessage(msgName);
    OscClientFactory.sendOscMessage("127.0.0.1", 8888, msg);
    Thread.sleep(100);
    Assert.assertEquals(msgName, lastMsgHandler.getOscPattern());
   
    msg = new OscMessage(msgNameTwo, param);
    OscClientFactory.sendOscMessage("127.0.0.1", 8888, msg);
    Thread.sleep(100);
    Assert.assertEquals(msgNameTwo, lastMsgHandler.getOscPattern());
    Assert.assertEquals(param, lastMsgHandler.getArgs()[0]);

    OscClientFactory.disconnectOscClient();
    Thread.sleep(100);

    srv1.stopServer();

    //recreate a new server on a new port, test osc client
    srv1 = OscServerFactory.createServer(this, 8889, 4096);
    srv1.startServer();
   
    msg = new OscMessage(msgName3, param);
    OscClientFactory.sendOscMessage("127.0.0.1", 8889, msg);
    Thread.sleep(100);
    Assert.assertEquals(msgName3, lastMsgHandler.getOscPattern());
    Assert.assertEquals(param, lastMsgHandler.getArgs()[0]);

    srv1.stopServer();
  }
View Full Code Here

Examples of com.neophob.sematrix.osc.server.impl.OscServer

  private OscMessage msg = null;
 
  @Test
  public void TestObserver() {
    OscServer srv = new TestOscServer(this);       
    srv.startServer();
    //initial / removed
    assertEquals("HELLO", msg.getPattern());
    assertEquals("WORLD", msg.getArgs()[0]);
    assertEquals(4, srv.getPacketCounter());
    assertTrue(srv.getBytesRecieved() > 20);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.