Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(socketio): add disconnect function #822

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/SocketIOclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ void SocketIOclient::setReconnectInterval(unsigned long time) {
return WebSocketsClient::setReconnectInterval(time);
}

void SocketIOclient::disconnect(void) {
WebSocketsClient::disconnect();
}

/**
* send text data to client
* @param num uint8_t client id
Expand Down
3 changes: 2 additions & 1 deletion src/SocketIOclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ class SocketIOclient : protected WebSocketsClient {
#endif
#endif
bool isConnected(void);

void onEvent(SocketIOclientEvent cbEvent);
void disconnect(void);

bool sendEVENT(uint8_t * payload, size_t length = 0, bool headerToPayload = false);
bool sendEVENT(const uint8_t * payload, size_t length = 0);
Expand Down