-
- All Known Subinterfaces:
OSCBidi
- All Known Implementing Classes:
OSCClient,OSCReceiver,OSCServer,OSCTransmitter
public interface OSCChannelA collection of common constants and methods that apply to all kinds of OSC communicators. Formely being abstract superclassAbstractOSCCommunicatorofOSCTransmitterandOSCReceiver, the functionality has been reduced and converted to an interface as of v0.30.The method for getting a socket's
DatagramChannelhas been removed in the course of TCP integration, also with keeping in mind the possible future integration of other channel types such asFileChannelorPipeChannel.- Since:
- NetUtil 0.30
- Version:
- 0.37, 12-May-09
- Author:
- Hanns Holger Rutz
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULTBUFSIZEThe default buffer size (in bytes) and maximum OSC packet size (8K at the moment).static intkDumpBothDump mode: dump messages both in text and hex viewstatic intkDumpHexDump mode: dump messages in hex (binary) viewstatic intkDumpOffDump mode: do not dump messagesstatic intkDumpTextDump mode: dump messages in text formattingstatic StringTCPProtocol type : transmission control protocol.static StringUDPProtocol type : user datagram protocol.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Disposes the resources associated with the OSC communicator.voiddumpOSC(int mode, PrintStream stream)Changes the way processed OSC messages are printed to the standard err console.intgetBufferSize()Queries the buffer size used for coding or decoding OSC messages.OSCPacketCodecgetCodec()Queries the codec used in packet coding and decoding.InetSocketAddressgetLocalAddress()Queries the communicator's local socket address.StringgetProtocol()Queries the transport protocol used by this communicator.voidsetBufferSize(int size)Adjusts the buffer size for OSC messages.voidsetCodec(OSCPacketCodec c)Specifies which codec is used in packet coding and decoding.
-
-
-
Field Detail
-
UDP
static final String UDP
Protocol type : user datagram protocol. en.wikipedia.org/wiki/User_Datagram_Protocol for explanation- See Also:
- Constant Field Values
-
TCP
static final String TCP
Protocol type : transmission control protocol. en.wikipedia.org/wiki/Transmission_Control_Protocol for explanation- See Also:
- Constant Field Values
-
kDumpOff
static final int kDumpOff
Dump mode: do not dump messages- See Also:
- Constant Field Values
-
kDumpText
static final int kDumpText
Dump mode: dump messages in text formatting- See Also:
- Constant Field Values
-
kDumpHex
static final int kDumpHex
Dump mode: dump messages in hex (binary) view- See Also:
- Constant Field Values
-
kDumpBoth
static final int kDumpBoth
Dump mode: dump messages both in text and hex view- See Also:
- Constant Field Values
-
DEFAULTBUFSIZE
static final int DEFAULTBUFSIZE
The default buffer size (in bytes) and maximum OSC packet size (8K at the moment).- See Also:
- Constant Field Values
-
-
Method Detail
-
getProtocol
String getProtocol()
Queries the transport protocol used by this communicator.
-
getLocalAddress
InetSocketAddress getLocalAddress() throws IOException
Queries the communicator's local socket address. You can determine the host and port from the returned address by callinggetHostName()(or for the IPgetAddress().getHostAddress()) andgetPort().- Returns:
- the address of the communicator's local socket.
- Throws:
IOException- if the local host could not be resolved- See Also:
InetSocketAddress.getHostName(),InetSocketAddress.getAddress(),InetSocketAddress.getPort(),getProtocol()
-
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.
-
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
-
getCodec
OSCPacketCodec getCodec()
Queries the codec used in packet coding and decoding.- Returns:
- the current codec of this channel
- Since:
- NetUtil 0.33
- See Also:
OSCPacketCodec.getDefaultCodec()
-
-