public class OSCResponderNode extends Object implements de.sciss.net.OSCListener
OSCMultiResponder
class
and NetUtil
.
As of v0.29 the creator signature had to be changed to use a Server
instead
of a network address, unfortunately (a side effect of using OSCClient
in Server
and OSCMultiResponder
). So you may need to update old code.
Modifier and Type | Class and Description |
---|---|
static interface |
OSCResponderNode.Action |
Constructor and Description |
---|
OSCResponderNode(Server s,
String cmdName,
de.sciss.net.OSCListener action)
Creates a new responder node to listen
for messages coming in from the given server.
|
OSCResponderNode(Server s,
String cmdName,
OSCResponderNode.Action action)
Creates a new responder node to listen
for messages coming in from the given server.
|
Modifier and Type | Method and Description |
---|---|
OSCResponderNode |
add()
Adds the node to the list of actively listening nodes.
|
String |
getCommandName()
Queries the name which is
used as the message filter
|
boolean |
isListening()
Queries the node's state.
|
void |
messageReceived(de.sciss.net.OSCMessage msg,
SocketAddress sender,
long time)
This method is called as part of
the implementation of the
OSCListener
interface. |
OSCResponderNode |
remove()
Removes the node from the list of actively
listening nodes.
|
OSCResponderNode |
removeWhenDone()
Tags the node to remove itself after the next
unfiltered message arrived.
|
public OSCResponderNode(Server s, String cmdName, de.sciss.net.OSCListener action)
After creating the responder, the add
method has to be called separately to actually start
the listening process.
s
- server of incoming messagescmdName
- name of the OSC command at whose
arrival the action is invokedaction
- the action's messageReceived
method is called upon message reception.
Note that just as specified in the
OSCListener
interface, the action
should not assume to be in any particular thread.
The current implementation calls the action in the
OSC listening thread, but this is not guaranteed.
Calls to Swing components should be deferred appropriately.Server
,
add()
public OSCResponderNode(Server s, String cmdName, OSCResponderNode.Action action)
After creating the responder, the add
method has to be called separately to actually start
the listening process.
s
- server of incoming messagescmdName
- name of the OSC command at whose
arrival the action is invokedaction
- the action's respond
method is called upon message reception.
Note that just as specified in the
OSCListener
interface, the action
should not assume to be in any particular thread.
The current implementation calls the action in the
OSC listening thread, but this is not guaranteed.
Calls to Swing components should be deferred appropriately.Server
,
add()
public String getCommandName()
public OSCResponderNode add() throws IOException
isListening
first, since this method will
throw an IllegalStateException
if you try
to add it twice.IllegalStateException
- if the node has already been addedIOException
remove()
,
isListening()
public boolean isListening()
true
if the node is active
(was added), false
otherwise
(newly created node or removed)public OSCResponderNode removeWhenDone()
add
method.public void messageReceived(de.sciss.net.OSCMessage msg, SocketAddress sender, long time)
OSCListener
interface. It dispatches the message to
the action. If removeWhenDone
was called, it will remove the node after
the action returns.messageReceived
in interface de.sciss.net.OSCListener
removeWhenDone()
public OSCResponderNode remove()
IOException
- if there was a problemadd()
Copyright © 2015–2022 SciJava. All rights reserved.