Interface OSCChannel

  • All Known Subinterfaces:
    OSCBidi
    All Known Implementing Classes:
    OSCClient, OSCReceiver, OSCServer, OSCTransmitter

    public interface OSCChannel
    A collection of common constants and methods that apply to all kinds of OSC communicators. Formely being abstract superclass AbstractOSCCommunicator of OSCTransmitter and OSCReceiver, the functionality has been reduced and converted to an interface as of v0.30.

    The method for getting a socket's DatagramChannel has been removed in the course of TCP integration, also with keeping in mind the possible future integration of other channel types such as FileChannel or PipeChannel.

    Since:
    NetUtil 0.30
    Version:
    0.37, 12-May-09
    Author:
    Hanns Holger Rutz
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULTBUFSIZE
      The default buffer size (in bytes) and maximum OSC packet size (8K at the moment).
      static int kDumpBoth
      Dump mode: dump messages both in text and hex view
      static int kDumpHex
      Dump mode: dump messages in hex (binary) view
      static int kDumpOff
      Dump mode: do not dump messages
      static int kDumpText
      Dump mode: dump messages in text formatting
      static String TCP
      Protocol type : transmission control protocol.
      static String UDP
      Protocol type : user datagram protocol.
    • Method Detail

      • getProtocol

        String getProtocol()
        Queries the transport protocol used by this communicator.
        Returns:
        the protocol, such as UDP or TCP
        See Also:
        UDP, TCP
      • setBufferSize

        void setBufferSize​(int size)
        Adjusts the buffer size for OSC messages. This is the maximum size an OSC packet (bundle or message) can grow to.
        Parameters:
        size - the new size in bytes.
        See Also:
        getBufferSize()
      • getBufferSize

        int getBufferSize()
        Queries the buffer size used for coding or decoding OSC messages. This is the maximum size an OSC packet (bundle or message) can grow to.
        Returns:
        the buffer size in bytes.
        See Also:
        setBufferSize( int )
      • dumpOSC

        void dumpOSC​(int mode,
                     PrintStream stream)
        Changes the way processed OSC messages are printed to the standard err console. By default messages are not printed.
        Parameters:
        mode - one of kDumpOff (don't dump, default), kDumpText (dump human readable string), kDumpHex (hexdump), or kDumpBoth (both text and hex)
        stream - the stream to print on, or null which is shorthand for System.err
        See Also:
        kDumpOff, kDumpText, kDumpHex, kDumpBoth
      • dispose

        void dispose()
        Disposes the resources associated with the OSC communicator. The object should not be used any more after calling this method.
      • setCodec

        void setCodec​(OSCPacketCodec c)
        Specifies which codec is used in packet coding and decoding.
        Parameters:
        c - the codec to use
        Since:
        NetUtil 0.33