-
Notifications
You must be signed in to change notification settings - Fork 575
-
I tried to find a way for the web sockets server to close a connection with a certain client if a condition is met and did not find how, any ideas on how i could implement this?
Below is a code snippet of exactly what i would like to accomplish
void ServerEventHandler(uint8_t ClientID, WStype_t Event, uint8_t * Payload, size_t Length)
{
switch(Event)
{
case WStype_CONNECTED:
if(LedsServer.remoteIP(ClientID) == <<DESIRED KNOWN LOCAL IP>>)
{
HandleNewConnection(Payload, Length);
}
else
{
// forcfully close the connection with <ClientID>
}
break;
}
}
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
You should be able to use this function void disconnect(uint8_t num); num is the client number
I found this in the server header file which list all functions and data types.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment