mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-26 05:47:12 +02:00
code style
This commit is contained in:
@ -42,8 +42,8 @@ WebSocketsServerCore::WebSocketsServerCore(const String& origin, const String& p
|
|||||||
memset(&_clients[0], 0x00, (sizeof(WSclient_t) * WEBSOCKETS_SERVER_CLIENT_MAX));
|
memset(&_clients[0], 0x00, (sizeof(WSclient_t) * WEBSOCKETS_SERVER_CLIENT_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
WebSocketsServer::WebSocketsServer(uint16_t port, const String& origin, const String& protocol):
|
WebSocketsServer::WebSocketsServer(uint16_t port, const String & origin, const String & protocol)
|
||||||
WebSocketsServerCore(origin, protocol) {
|
: WebSocketsServerCore(origin, protocol) {
|
||||||
_port = port;
|
_port = port;
|
||||||
|
|
||||||
_server = new WEBSOCKETS_NETWORK_SERVER_CLASS(port);
|
_server = new WEBSOCKETS_NETWORK_SERVER_CLASS(port);
|
||||||
@ -538,8 +538,7 @@ void WebSocketsServerCore::messageReceived(WSclient_t * client, WSopcode_t opcod
|
|||||||
* Discard a native client
|
* Discard a native client
|
||||||
* @param client WSclient_t * ptr to the client struct contaning the native client "->tcp"
|
* @param client WSclient_t * ptr to the client struct contaning the native client "->tcp"
|
||||||
*/
|
*/
|
||||||
void WebSocketsServerCore::dropNativeClient (WSclient_t * client)
|
void WebSocketsServerCore::dropNativeClient(WSclient_t * client) {
|
||||||
{
|
|
||||||
if(client->tcp) {
|
if(client->tcp) {
|
||||||
if(client->tcp->connected()) {
|
if(client->tcp->connected()) {
|
||||||
#if(WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC) && (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP32)
|
#if(WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC) && (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP32)
|
||||||
@ -631,7 +630,6 @@ bool WebSocketsServerCore::clientIsConnected(WSclient_t * client) {
|
|||||||
* Handle incoming Connection Request
|
* Handle incoming Connection Request
|
||||||
*/
|
*/
|
||||||
WSclient_t * WebSocketsServerCore::handleNewClient(WEBSOCKETS_NETWORK_CLASS * tcpClient) {
|
WSclient_t * WebSocketsServerCore::handleNewClient(WEBSOCKETS_NETWORK_CLASS * tcpClient) {
|
||||||
|
|
||||||
WSclient_t * client = newClient(tcpClient);
|
WSclient_t * client = newClient(tcpClient);
|
||||||
|
|
||||||
if(!client) {
|
if(!client) {
|
||||||
@ -971,4 +969,3 @@ void WebSocketsServer::loop(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user