public class NetworkCommunication
extends java.lang.Object
HB
class.Modifier and Type | Field and Description |
---|---|
FileReceiver |
fileReceiver
Class for receiving non java files from network
|
Constructor and Description |
---|
NetworkCommunication(HB _hb)
Instantiate a new
NetworkCommunication object. |
Modifier and Type | Method and Description |
---|---|
void |
addListener(de.sciss.net.OSCListener l)
Add a @
OSCListener that will respond to incoming OSC messages from the controller. |
void |
clearListeners()
Clear all @
OSCListener s. |
int |
getID()
Get the ID of this device, as assigned by the controller.
|
void |
removeListener(de.sciss.net.OSCListener l)
Remove the given
OSCListener . |
void |
send(de.sciss.net.OSCMessage msg,
java.net.InetSocketAddress target)
Send a Built OSC Message to server
|
void |
send(java.lang.String msg_name,
java.lang.Object[] args)
Send an OSC message to the controller.
|
void |
send(java.lang.String msg,
java.lang.Object[] args,
java.net.InetSocketAddress requester)
Send an OSC message to an Address other than the one we have configured as our controller
|
void |
send(java.lang.String msg,
java.lang.Object[] args,
java.net.SocketAddress requester)
Send an OSC message to an Address other than the one we have configured as our controller
|
void |
sendLogs(boolean send_logs)
Start or stop sending log messages to the controller.
|
static boolean |
sendNetworkOSCMessages(de.sciss.net.OSCMessage msg,
java.util.Collection<java.lang.String> target,
boolean skip_self)
Send OSC Message across network to one or more targets
|
boolean |
sendTcp(de.sciss.net.OSCMessage msg,
java.net.SocketAddress target)
Send a Built OSC Message to server
|
public FileReceiver fileReceiver
public NetworkCommunication(HB _hb) throws java.io.IOException
NetworkCommunication
object._hb
- the HB
object this object is attached to.java.io.IOException
- thrown if there is a problem opening the OSCServer
, likely due to the port already being in use.public void send(java.lang.String msg_name, java.lang.Object[] args)
msg_name
- the message name.args
- the message arguments.public void send(java.lang.String msg, java.lang.Object[] args, java.net.InetSocketAddress requester)
msg
- the message nameargs
- the message argumentsrequester
- the Address of the device making requestpublic void send(java.lang.String msg, java.lang.Object[] args, java.net.SocketAddress requester)
msg
- the message nameargs
- the message argumentsrequester
- the Address of the device making requestpublic void send(de.sciss.net.OSCMessage msg, java.net.InetSocketAddress target)
msg
- OSC Messagetarget
- where we need to send messagepublic boolean sendTcp(de.sciss.net.OSCMessage msg, java.net.SocketAddress target)
msg
- OSC Messagetarget
- where we need to send messagepublic void addListener(de.sciss.net.OSCListener l)
OSCListener
that will respond to incoming OSC messages from the controller. Note that this will not listen to broadcast messages from other devices, for which you should use TODO!.l
- the listener.public void removeListener(de.sciss.net.OSCListener l)
OSCListener
.l
- the listener to remove.public void clearListeners()
OSCListener
s.public int getID()
public void sendLogs(boolean send_logs)
send_logs
- true to start, false to stop.public static boolean sendNetworkOSCMessages(de.sciss.net.OSCMessage msg, java.util.Collection<java.lang.String> target, boolean skip_self)
msg
- the OSC Message we are sendingtarget
- a list of targets. If null, will broadcastskip_self
- set to true if we are not going to send to ourself