Instances are completely independent from each other. Table operations on
one instance will not be visible to other instances unless the instances are
connected via the network. The main limitation on instances is that you
cannot have two servers on the same network port. The main utility of
instances is for unit testing, but they can also enable one program to
connect to two different NetworkTables networks.

The global "default" instance (as returned by getDefault()) is
always available, and is intended for the common case when there is only
a single NetworkTables instance being used in the program.

Additional instances can be created with the create() function.
A reference must be kept to the NetworkTableInstance returned by this
function to keep it from being garbage collected.

removeEntryListener

public void removeEntryListener​(int listener)

Remove an entry listener.

Parameters:

listener - Listener handle to remove

waitForEntryListenerQueue

public boolean waitForEntryListenerQueue​(double timeout)

Wait for the entry listener queue to be empty. This is primarily useful
for deterministic testing. This blocks until either the entry listener
queue is empty (e.g. there are no more events that need to be passed along
to callbacks or poll queues) or the timeout expires.

Parameters:

timeout - timeout, in seconds. Set to 0 for non-blocking behavior,
or a negative value to block indefinitely

removeConnectionListener

waitForConnectionListenerQueue

public boolean waitForConnectionListenerQueue​(double timeout)

Wait for the connection listener queue to be empty. This is primarily useful
for deterministic testing. This blocks until either the connection listener
queue is empty (e.g. there are no more events that need to be passed along
to callbacks or poll queues) or the timeout expires.

Parameters:

timeout - timeout, in seconds. Set to 0 for non-blocking behavior,
or a negative value to block indefinitely

Returns:

False if timed out, otherwise true.

createRpc

Create a callback-based RPC entry point. Only valid to use on the server.
The callback function will be called when the RPC is called.
This function creates RPC version 0 definitions (raw data in and out).

Parameters:

entry - the entry

callback - callback function

waitForRpcCallQueue

public boolean waitForRpcCallQueue​(double timeout)

Wait for the incoming RPC call queue to be empty. This is primarily useful
for deterministic testing. This blocks until either the RPC call
queue is empty (e.g. there are no more events that need to be passed along
to callbacks or poll queues) or the timeout expires.

Parameters:

timeout - timeout, in seconds. Set to 0 for non-blocking behavior,
or a negative value to block indefinitely

addLogger

Add logger callback function. By default, log messages are sent to stderr;
this function sends log messages with the specified levels to the provided
callback function instead. The callback function will only be called for
log messages with level greater than or equal to minLevel and less than or
equal to maxLevel; messages outside this range will be silently ignored.

Parameters:

func - log callback function

minLevel - minimum log level

maxLevel - maximum log level

Returns:

Logger handle

removeLogger

public void removeLogger​(int logger)

Remove a logger.

Parameters:

logger - Logger handle to remove

waitForLoggerQueue

public boolean waitForLoggerQueue​(double timeout)

Wait for the incoming log event queue to be empty. This is primarily useful
for deterministic testing. This blocks until either the log event
queue is empty (e.g. there are no more events that need to be passed along
to callbacks or poll queues) or the timeout expires.

Parameters:

timeout - timeout, in seconds. Set to 0 for non-blocking behavior,
or a negative value to block indefinitely