|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.illposed.osc.OSCPort
com.illposed.osc.OSCPortIn
OSCPortIn is the class that listens for OSC messages.
An example based on com.illposed.osc.test.OSCPortTest::testReceiving() :
receiver = new OSCPortIn(OSCPort.defaultSCOSCPort());
OSCListener listener = new OSCListener() {
public void acceptMessage(java.util.Date time, OSCMessage message) {
System.out.println("Message received!");
}
};
receiver.addListener("/message/receiving", listener);
receiver.startListening();
Then, using a program such as SuperCollider or sendOSC, send a message to this computer, port 57110 (defaultSCOSCPort), with the address /message/receiving
Copyright (C) 2004-2006, C. Ramakrishnan / Illposed Software. All rights reserved.
See license.txt (or license.rtf) for license information.
| Field Summary | |
protected OSCByteArrayToJavaConverter |
converter
|
protected OSCPacketDispatcher |
dispatcher
|
protected boolean |
isListening
|
| Fields inherited from class com.illposed.osc.OSCPort |
port, socket |
| Constructor Summary | |
OSCPortIn(int port)
Create an OSCPort that listens on the specified port. |
|
| Method Summary | |
void |
addListener(java.lang.String anAddress,
OSCListener listener)
Register the listener for incoming OSCPackets addressed to an Address |
void |
close()
Close the socket and free-up resources. |
boolean |
isListening()
Am I listening for packets? |
void |
run()
Run the loop that listens for OSC on a socket until isListening becomes false. |
void |
startListening()
Start listening for incoming OSCPackets |
void |
stopListening()
Stop listening for incoming OSCPackets |
| Methods inherited from class com.illposed.osc.OSCPort |
defaultSCLangOSCPort, defaultSCOSCPort, finalize |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean isListening
protected OSCByteArrayToJavaConverter converter
protected OSCPacketDispatcher dispatcher
| Constructor Detail |
public OSCPortIn(int port)
throws java.net.SocketException
port - UDP port to listen on.
java.net.SocketException| Method Detail |
public void run()
run in interface java.lang.RunnableRunnable.run()public void startListening()
public void stopListening()
public boolean isListening()
public void addListener(java.lang.String anAddress,
OSCListener listener)
anAddress - the address to listen forlistener - the object to invoke when a message comes inpublic void close()
close in class OSCPort
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||