Skip to content

Commit 628f674

Browse files
committed
Added function to close and reopen socket.
1 parent 266c330 commit 628f674

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pynetworktables2js/js/networktables.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ var NetworkTables = new function () {
272272
this.isWsConnected = function() {
273273
return socketOpen;
274274
};
275+
276+
// Closes socket and reopens it
277+
this.closeSocket = function() {
278+
if (socket) {
279+
socket.close();
280+
}
281+
};
275282

276283
/**
277284
Sets the value in NetworkTables. If the websocket is not connected, the

0 commit comments

Comments
 (0)