mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Adds StopNotifier and StopRpcServer functions
Workaround for #30. Allows libraries to shut down the secondary threads.
This commit is contained in:
@@ -350,6 +350,16 @@ void NT_StartClient(const char *server_name, unsigned int port);
|
||||
*/
|
||||
void NT_StopClient(void);
|
||||
|
||||
/** Stop Rpc Server
|
||||
* Stops the Rpc server if it is running.
|
||||
*/
|
||||
void NT_StopRpcServer(void);
|
||||
|
||||
/** Stop Notifier
|
||||
* Stops the Notifier (Entry and Connection Listener) thread if it is running.
|
||||
*/
|
||||
void NT_StopNotifier(void);
|
||||
|
||||
/** Set Update Rate
|
||||
* Sets the update rate of the table
|
||||
*
|
||||
|
||||
@@ -229,6 +229,8 @@ void StartServer(StringRef persist_filename, const char* listen_address,
|
||||
void StopServer();
|
||||
void StartClient(const char* server_name, unsigned int port);
|
||||
void StopClient();
|
||||
void StopRpcServer();
|
||||
void StopNotifier();
|
||||
void SetUpdateRate(double interval);
|
||||
std::vector<ConnectionInfo> GetConnections();
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ NT_DisposeEntryInfoArray @76
|
||||
NT_AllocateCharArray @77
|
||||
NT_FreeCharArray @78
|
||||
NT_NotifierDestroyed @79
|
||||
NT_StopRpcServer @80
|
||||
NT_StopNotifier @81
|
||||
|
||||
; JNI functions
|
||||
JNI_OnLoad
|
||||
|
||||
@@ -333,6 +333,14 @@ void NT_StopClient(void) {
|
||||
nt::StopClient();
|
||||
}
|
||||
|
||||
void NT_StopRpcServer(void) {
|
||||
nt::StopRpcServer();
|
||||
}
|
||||
|
||||
void NT_StopNotifier(void) {
|
||||
nt::StopNotifier();
|
||||
}
|
||||
|
||||
void NT_SetUpdateRate(double interval) {
|
||||
nt::SetUpdateRate(interval);
|
||||
}
|
||||
|
||||
@@ -230,6 +230,14 @@ void StopClient() {
|
||||
Dispatcher::GetInstance().Stop();
|
||||
}
|
||||
|
||||
void StopRpcServer() {
|
||||
RpcServer::GetInstance().Stop();
|
||||
}
|
||||
|
||||
void StopNotifier() {
|
||||
Notifier::GetInstance().Stop();
|
||||
}
|
||||
|
||||
void SetUpdateRate(double interval) {
|
||||
Dispatcher::GetInstance().SetUpdateRate(interval);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user