- java.lang.Object
-
- org.praxislive.internal.osc.OSCReceiver
-
- All Implemented Interfaces:
Runnable,OSCChannel
public abstract class OSCReceiver extends Object implements OSCChannel, Runnable
AnOSCReceivermanages reception of incoming OSC messages. A receiver can be either revivable or non-revivable.- A non-revivable receiver is bound to one particular network channel
(
DatagramChannel(for UDP) orSocketChannel(for TCP)). When the channel is closed, the receiver cannot be restarted. The network channel is closed for example when a TCP server shuts down, but also when trying to connect to a TCP server that is not yet reachable. - It is therefore recommended to use revivable receivers. A revivable receiver
is created through one of the
newUsingconstructors that takes a protocol and address argument. A revivable receiver can be restarted because it recreates the network channel if necessary.
The receiver launches a listening
ThreadwhenstartListeningis called.The
OSCReceiverhas methods for registering and unregistering listeners that get informed about incoming messages. Filtering out specific messages must be done by the listeners.The listening thread is stopped using
stopListeningmethod.Note that as of v0.3, you will most likely want to use preferably one of
OSCClientorOSCServeroverOSCReceiver. Also note that as of v0.3,OSCReceiveris abstract, which renders direct instantiation impossible. To update old code, occurrences ofnew OSCReceiver()must be replaced by one of theOSCReceiver.newUsingmethods! The "filter" functionality of NetUtil 0.2 is now implied by callingsetTarget( SocketAddress ).Here is an example that also demonstrates message sending using an instance of
OSCTransmitter:OSCReceiver rcv = null; OSCTransmitter trns; DatagramChannel dch = null; try { final SocketAddress addr = new InetSocketAddress( InetAddress.getLocalHost(), 57110 ); final Object notify = new Object(); // note: using constructors with SelectableChannel implies the receivers and // transmitters cannot be revived. to create revivable channels on the same socket, // you must use one of the newUsing methods that take an IP address and/or port // number. dch = DatagramChannel.open(); dch.socket().bind( null ); // assigns an automatic local socket address rcv = OSCReceiver.newUsing( dch ); trns = OSCTransmitter.newUsing( dch ); rcv.addOSCListener( new OSCListener() { public void messageReceived( OSCMessage msg, SocketAddress sender, long time ) { if( msg.getName().equals( "status.reply" )) { System.out.println( "scsynth is running. contains " + msg.getArg( 1 ) + " unit generators, " + msg.getArg( 2 ) + " synths, " + msg.getArg( 3 ) + " groups, " + msg.getArg( 4 ) + " synth defs.\n" + "CPU load is " + msg.getArg( 5 ) + "% (average) / " + msg.getArg( 6 ) + "% (peak)" ); synchronized( notify ) { notify.notifyAll(); } } } }); rcv.startListening(); trns.send( new OSCMessage( "/status", OSCMessage.NO_ARGS ), addr ); synchronized( notify ) { notify.wait( 5000 ); } } catch( InterruptedException e1 ) {} catch( IOException e2 ) { System.err.println( e2.getLocalizedMessage() ); } finally { if( rcv != null ) { rcv.dispose(); } else if( dch != null ) { try { dch.close(); } catch( IOException e4 ) {}; } }Note that the datagram channel needs to be bound to a valid reachable address, becausestopListeningwill be sending a terminating message to this channel. You can bind the channel usingdch.socket().bind(), as shown in the example above.Note that someone has reported trouble with the
InetAddress.getLocalHost()method on a machine that has no proper IP configuration or DNS problems. In such a case when you need to communicate only on this machine and not a network, use the loopback address "127.0.0.1" as the filtering address or bind the socket to the loop address manually before callingnew OSCReceiver().- Version:
- 0.37, 12-May-09
- Author:
- Hanns Holger Rutz
- See Also:
OSCClient,OSCServer,OSCTransmitter
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallocBufprotected ByteBufferbyteBufprotected ObjectgeneralSyncprotected booleanisListeningprotected InetSocketAddresslocalAddressprotected booleanrevivableprotected SocketAddresstargetprotected Threadthreadprotected ObjectthreadSync-
Fields inherited from interface org.praxislive.internal.osc.OSCChannel
DEFAULTBUFSIZE, kDumpBoth, kDumpHex, kDumpOff, kDumpText, TCP, UDP
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOSCReceiver(OSCPacketCodec c, String protocol, InetSocketAddress localAddress, boolean revivable)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddOSCListener(OSCListener listener)Registers a listener that gets informed about incoming messages.protected voidcheckBuffer()protected abstract voidcloseChannel()abstract voidconnect()Establishes connection for transports requiring connectivity (e.g.protected static StringdebugTimeString()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.protected voidflipDecodeDispatch(SocketAddress sender)intgetBufferSize()Queries the buffer size used for coding or decoding OSC messages.OSCPacketCodecgetCodec()Queries the codec used in packet coding and decoding.abstract InetSocketAddressgetLocalAddress()Queries the receiver's local socket address.protected InetSocketAddressgetLocalAddress(InetAddress addr, int port)StringgetProtocol()Queries the transport protocol used by this communicator.abstract booleanisConnected()Queries the connection state of the receiver.booleanisListening()Queries whether theOSCReceiveris listening or not.static OSCReceivernewUsing(String protocol)Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol.static OSCReceivernewUsing(String protocol, int port)Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and port.static OSCReceivernewUsing(String protocol, int port, boolean loopBack)Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and port.static OSCReceivernewUsing(String protocol, InetSocketAddress localAddress)Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and local socket address.static OSCReceivernewUsing(DatagramChannel dch)Creates a new instance of a non-revivableOSCReceiver, using default codec and UDP transport on a given channel.static OSCReceivernewUsing(SocketChannel sch)Creates a new instance of a non-revivableOSCReceiver, using default codec and TCP transport on a given channel.static OSCReceivernewUsing(OSCPacketCodec c, String protocol)Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol.static OSCReceivernewUsing(OSCPacketCodec c, String protocol, int port)Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and port.static OSCReceivernewUsing(OSCPacketCodec c, String protocol, int port, boolean loopBack)Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and port.static OSCReceivernewUsing(OSCPacketCodec c, String protocol, InetSocketAddress localAddress)Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and local socket address.static OSCReceivernewUsing(OSCPacketCodec c, DatagramChannel dch)Creates a new instance of a non-revivableOSCReceiver, using a specific codec and UDP transport on a given channel.static OSCReceivernewUsing(OSCPacketCodec c, SocketChannel sch)Creates a new instance of a non-revivableOSCReceiver, using a specific codec and TCP transport on a given channel.voidremoveOSCListener(OSCListener listener)Unregisters a listener that gets informed about incoming messagesprotected abstract voidsendGuardSignal()voidsetBufferSize(int size)Adjusts the buffer size for OSC messages.protected abstract voidsetChannel(SelectableChannel ch)voidsetCodec(OSCPacketCodec c)Specifies which codec is used in packet coding and decoding.abstract voidsetTarget(SocketAddress target)voidstartListening()Starts to wait for incoming messages.voidstopListening()Stops waiting for incoming messages.
-
-
-
Field Detail
-
thread
protected Thread thread
-
generalSync
protected final Object generalSync
-
threadSync
protected final Object threadSync
-
isListening
protected boolean isListening
-
byteBuf
protected ByteBuffer byteBuf
-
allocBuf
protected boolean allocBuf
-
localAddress
protected final InetSocketAddress localAddress
-
revivable
protected final boolean revivable
-
target
protected SocketAddress target
-
-
Constructor Detail
-
OSCReceiver
protected OSCReceiver(OSCPacketCodec c, String protocol, InetSocketAddress localAddress, boolean revivable)
-
-
Method Detail
-
newUsing
public static OSCReceiver newUsing(String protocol) throws IOException
Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol. It picks an arbitrary free port and uses the local machine's IP. To determine the resulting port, you can usegetLocalAddressafterwards.TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
protocol- the protocol to use, currently eitherUDPorTCP- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used- See Also:
OSCChannel.UDP,OSCChannel.TCP,getLocalAddress()
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, String protocol) throws IOException
Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol. It picks an arbitrary free port and uses the local machine's IP. To determine the resulting port, you can usegetLocalAddressafterwards.TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
c- the codec to useprotocol- the protocol to use, currently eitherUDPorTCP- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used- Since:
- NetUtil 0.33
- See Also:
OSCChannel.UDP,OSCChannel.TCP,getLocalAddress()
-
newUsing
public static OSCReceiver newUsing(String protocol, int port) throws IOException
Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and port. It uses the local machine's IP. Note that theportspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
protocol- the protocol to use, currently eitherUDPorTCPport- the port number for the OSC socket, or0to use an arbitrary free port- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, String protocol, int port) throws IOException
Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and port. It uses the local machine's IP. Note that theportspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
c- the codec to useprotocol- the protocol to use, currently eitherUDPorTCPport- the port number for the OSC socket, or0to use an arbitrary free port- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used- Since:
- NetUtil 0.33
-
newUsing
public static OSCReceiver newUsing(String protocol, int port, boolean loopBack) throws IOException
Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and port. It uses the local machine's IP or the "loopback" address. Note that theportspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
protocol- the protocol to use, currently eitherUDPorTCPport- the port number for the OSC socket, or0to use an arbitrary free portloopBack- iftrue, the "loopback" address ("127.0.0.1") is used which limits communication to the local machine. Iffalse, the special IP"0.0.0.0"is used which means messages from any IP as well as from the loopback are accepted- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, String protocol, int port, boolean loopBack) throws IOException
Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and port. It uses the local machine's IP or the "loopback" address. Note that theportspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
c- the codec to useprotocol- the protocol to use, currently eitherUDPorTCPport- the port number for the OSC socket, or0to use an arbitrary free portloopBack- iftrue, the "loopback" address ("127.0.0.1") is used which limits communication to the local machine. Iffalse, the special IP"0.0.0.0"is used which means messages from any IP as well as from the loopback are accepted- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used- Since:
- NetUtil 0.33
-
newUsing
public static OSCReceiver newUsing(String protocol, InetSocketAddress localAddress) throws IOException
Creates a new instance of a revivableOSCReceiver, using default codec and a specific transport protocol and local socket address. Note thatlocalAdressspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
protocol- the protocol to use, currently eitherUDPorTCPlocalAddress- a valid address to use for the OSC socket. If the port is0, an arbitrary free port is picked when the receiver is started. (you can find out the actual port in this case by callinggetLocalAddress()after the receiver was started).- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, String protocol, InetSocketAddress localAddress) throws IOException
Creates a new instance of a revivableOSCReceiver, using a specific codec and transport protocol and local socket address. Note that theportspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!TCP receivers are required to be connected to one particular target, so
setTargetis must be called prior toconnectorstartListening!- Parameters:
c- the codec to useprotocol- the protocol to use, currently eitherUDPorTCPlocalAddress- a valid address to use for the OSC socket. If the port is0, an arbitrary free port is picked when the receiver is started. (you can find out the actual port in this case by callinggetLocalAddress()after the receiver was started).- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while creating the socketIllegalArgumentException- if an illegal protocol is used- Since:
- NetUtil 0.33
-
newUsing
public static OSCReceiver newUsing(DatagramChannel dch) throws IOException
Creates a new instance of a non-revivableOSCReceiver, using default codec and UDP transport on a given channel. The caller should ensure that the provided channel's socket was bound to a valid address (usingdch.socket().bind( SocketAddress )). Note thatdchspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!- Parameters:
dch- theDatagramChannelto use as UDP socket.- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while configuring the socket
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, DatagramChannel dch) throws IOException
Creates a new instance of a non-revivableOSCReceiver, using a specific codec and UDP transport on a given channel. The caller should ensure that the provided channel's socket was bound to a valid address (usingdch.socket().bind( SocketAddress )). Note thatdchspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. If you want to filter out a particular remote (or target) socket, this can be done using thesetTargetmethod!- Parameters:
c- the codec to usedch- theDatagramChannelto use as UDP socket.- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while configuring the socket- Since:
- NetUtil 0.33
-
newUsing
public static OSCReceiver newUsing(SocketChannel sch) throws IOException
Creates a new instance of a non-revivableOSCReceiver, using default codec and TCP transport on a given channel. The caller should ensure that the provided channel's socket was bound to a valid address (usingsch.socket().bind( SocketAddress )). Furthermore, the channel must be connected (usingconnect()) before being able to receive messages. Note thatschspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. The remote (or target) socket must be explicitly specified usingsetTargetbefore trying to connect!- Parameters:
sch- theSocketChannelto use as TCP socket.- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while configuring the socket
-
newUsing
public static OSCReceiver newUsing(OSCPacketCodec c, SocketChannel sch) throws IOException
Creates a new instance of a non-revivableOSCReceiver, using a specific codec and TCP transport on a given channel. The caller should ensure that the provided channel's socket was bound to a valid address (usingsch.socket().bind( SocketAddress )). Furthermore, the channel must be connected (usingconnect()) before being able to receive messages. Note thatschspecifies the local socket (at which the receiver listens), it does not determine the remote sockets from which messages can be received. The remote (or target) socket must be explicitly specified usingsetTargetbefore trying to connect!- Parameters:
c- the codec to usesch- theSocketChannelto use as TCP socket.- Returns:
- the newly created receiver
- Throws:
IOException- if a networking error occurs while configuring the socket- Since:
- NetUtil 0.33
-
getProtocol
public String getProtocol()
Description copied from interface:OSCChannelQueries the transport protocol used by this communicator.- Specified by:
getProtocolin interfaceOSCChannel- Returns:
- the protocol, such as
UDPorTCP - See Also:
OSCChannel.UDP,OSCChannel.TCP
-
getLocalAddress
public abstract InetSocketAddress getLocalAddress() throws IOException
Queries the receiver's local socket address. You can determine the host and port from the returned address by callinggetHostName()(or for the IPgetAddress().getHostAddress()) andgetPort(). This port number may be0if the receiver was called with an unspecified port and has not yet been started. In this case, to determine the port actually used, call this method after the receiver has been started.Note that if the receiver is bound to the accept-any IP
"0.0.0.0", which happens for example when callingnewUsing( <protocol>, 0, false ), the returned IP will be the localhost's IP, so you can patch the result directly into anysetTargetcall.- Specified by:
getLocalAddressin interfaceOSCChannel- Returns:
- the address of the receiver's local socket.
- Throws:
IOException- if the local host could not be resolved- See Also:
InetSocketAddress.getHostName(),InetSocketAddress.getAddress(),InetSocketAddress.getPort()
-
setTarget
public abstract void setTarget(SocketAddress target)
-
setCodec
public void setCodec(OSCPacketCodec c)
Description copied from interface:OSCChannelSpecifies which codec is used in packet coding and decoding.- Specified by:
setCodecin interfaceOSCChannel- Parameters:
c- the codec to use
-
getCodec
public OSCPacketCodec getCodec()
Description copied from interface:OSCChannelQueries the codec used in packet coding and decoding.- Specified by:
getCodecin interfaceOSCChannel- Returns:
- the current codec of this channel
- See Also:
OSCPacketCodec.getDefaultCodec()
-
addOSCListener
public void addOSCListener(OSCListener listener)
Registers a listener that gets informed about incoming messages. You can call this both when listening was started and stopped.- Parameters:
listener- the listener to register
-
removeOSCListener
public void removeOSCListener(OSCListener listener)
Unregisters a listener that gets informed about incoming messages- Parameters:
listener- the listener to remove from the list of notified objects.
-
startListening
public void startListening() throws IOExceptionStarts to wait for incoming messages. See the class constructor description to learn how connected and unconnected channels are handled. You should never modify the the channel's setup between the constructor and callingstartListening. This method will check the connection status of the channel, usingisConnectedand establish the connection if necessary. Therefore, callingconnectprior tostartListeningis not necessary.To find out at which port we are listening, call
getLocalAddress().getPort().If the
OSCReceiveris already listening, this method does nothing.- Throws:
IOException- when an error occurs while establishing the channel connection. In that case, no thread has been started and hence stopListening() needn't be calledIllegalStateException- when trying to call this method from within the OSC receiver thread (which would obviously cause a loop)
-
isListening
public boolean isListening()
Queries whether theOSCReceiveris listening or not.
-
stopListening
public void stopListening() throws IOExceptionStops waiting for incoming messages. This method returns when the receiving thread has terminated. To prevent deadlocks, this method cancels after five seconds, callingclose()on the datagram channel, which causes the listening thread to die because of a channel-closing exception.- Throws:
IOException- if an error occurs while shutting downIllegalStateException- when trying to call this method from within the OSC receiver thread (which would obviously cause a loop)
-
setBufferSize
public void setBufferSize(int size)
Description copied from interface:OSCChannelAdjusts the buffer size for OSC messages. This is the maximum size an OSC packet (bundle or message) can grow to.- Specified by:
setBufferSizein interfaceOSCChannel- Parameters:
size- the new size in bytes.- See Also:
OSCChannel.getBufferSize()
-
getBufferSize
public int getBufferSize()
Description copied from interface:OSCChannelQueries the buffer size used for coding or decoding OSC messages. This is the maximum size an OSC packet (bundle or message) can grow to.- Specified by:
getBufferSizein interfaceOSCChannel- Returns:
- the buffer size in bytes.
- See Also:
OSCChannel.setBufferSize( int )
-
dumpOSC
public void dumpOSC(int mode, PrintStream stream)Description copied from interface:OSCChannelChanges the way processed OSC messages are printed to the standard err console. By default messages are not printed.- Specified by:
dumpOSCin interfaceOSCChannel- Parameters:
mode- one ofkDumpOff(don't dump, default),kDumpText(dump human readable string),kDumpHex(hexdump), orkDumpBoth(both text and hex)stream- the stream to print on, ornullwhich is shorthand forSystem.err- See Also:
OSCChannel.kDumpOff,OSCChannel.kDumpText,OSCChannel.kDumpHex,OSCChannel.kDumpBoth
-
dispose
public void dispose()
Description copied from interface:OSCChannelDisposes the resources associated with the OSC communicator. The object should not be used any more after calling this method.- Specified by:
disposein interfaceOSCChannel
-
sendGuardSignal
protected abstract void sendGuardSignal() throws IOException- Throws:
IOException
-
setChannel
protected abstract void setChannel(SelectableChannel ch) throws IOException
- Throws:
IOException
-
closeChannel
protected abstract void closeChannel() throws IOException- Throws:
IOException
-
debugTimeString
protected static String debugTimeString()
-
flipDecodeDispatch
protected void flipDecodeDispatch(SocketAddress sender) throws IOException
- Throws:
IOException
-
checkBuffer
protected void checkBuffer()
-
getLocalAddress
protected InetSocketAddress getLocalAddress(InetAddress addr, int port) throws UnknownHostException
- Throws:
UnknownHostException
-
connect
public abstract void connect() throws IOExceptionEstablishes connection for transports requiring connectivity (e.g. TCP). For transports that do not require connectivity (e.g. UDP), this ensures the communication channel is created and bound.Having a connected channel without actually listening to incoming messages is usually not making sense. You can call
startListeningwithout explicit prior call toconnect, becausestartListeningwill establish the connection if necessary.When a UDP transmitter is created without an explicit
DatagramChannel– say by callingOSCReceiver.newUsing( "udp" ), callingconnect()will actually create and bind aDatagramChannel. For a UDP receiver which was created with an explicitDatagramChannel. However, for TCP receivers, this may throw anIOExceptionif the receiver was already connected, therefore be sure to checkisConnected()before.- Throws:
IOException- if a networking error occurs. Possible reasons: - the underlying network channel had been closed by the server. - the transport is TCP and the server is not available.IOException- See Also:
isConnected(),startListening()
-
isConnected
public abstract boolean isConnected()
Queries the connection state of the receiver.- Returns:
trueif the receiver is connected,falseotherwise. For transports that do not use connectivity (e.g. UDP) this returnsfalse, if the underlyingDatagramChannelhas not yet been created.- See Also:
connect()
-
-