com.illposed.osc
Class OSCPortIn

java.lang.Object
  extended by com.illposed.osc.OSCPort
      extended by com.illposed.osc.OSCPortIn
All Implemented Interfaces:
java.lang.Runnable

public class OSCPortIn
extends OSCPort
implements java.lang.Runnable


Constructor Summary
OSCPortIn(int port)
          Create an OSCPort that listens on port
 
Method Summary
 void addListener(java.lang.String anAddress, OSCListener listener)
          Register the listener for incoming OSCPackets addressed to an Address
 boolean changeListenerAddress(java.lang.String oldAddress, java.lang.String newAddress)
           
 void close()
          Close the socket and free-up resources.
 OSCListener getListener(java.lang.String anAddress)
           
 boolean isListening()
          Am I listening for packets?
 void removeAllListeners()
          Un-register all existing listeners
 boolean removeListener(java.lang.String anAddress)
           
 void run()
           
 void startListening()
          Start listening for incoming OSCPackets
 void stopListening()
          Stop listening for incoming OSCPackets
 
Methods inherited from class com.illposed.osc.OSCPort
defaultSCLangOSCPort, defaultSCOSCPort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSCPortIn

public OSCPortIn(int port)
          throws java.net.SocketException
Create an OSCPort that listens on port

Parameters:
port -
Throws:
java.net.SocketException
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

startListening

public void startListening()
Start listening for incoming OSCPackets


stopListening

public void stopListening()
Stop listening for incoming OSCPackets


isListening

public boolean isListening()
Am I listening for packets?


addListener

public void addListener(java.lang.String anAddress,
                        OSCListener listener)
Register the listener for incoming OSCPackets addressed to an Address

Parameters:
anAddress - the address to listen for
listener - the object to invoke when a message comes in

removeAllListeners

public void removeAllListeners()
Un-register all existing listeners


removeListener

public boolean removeListener(java.lang.String anAddress)

getListener

public OSCListener getListener(java.lang.String anAddress)

changeListenerAddress

public boolean changeListenerAddress(java.lang.String oldAddress,
                                     java.lang.String newAddress)

close

public void close()
Close the socket and free-up resources. It's recommended that clients call this when they are done with the port.

Overrides:
close in class OSCPort