.\" .\" Copyright (C) 2016-2022 Davidson Francis .\" .\" This program is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" .TH man 3 "04 Apr 2022" "1.0" "wsServer man page" .SH NAME ws_get_state \- Get a client current state .SH SYNOPSIS .nf .B #include .sp .BI "int ws_get_state(ws_cli_conn_t " *client "); .fi .SH DESCRIPTION .BR ws_get_state () for a given client .I client , gets the current state. Valid states are: .PP .RS 2 .IP \(em 2 WS_STATE_CONNECTING (0) .IP \(em 2 WS_STATE_OPEN (1) .IP \(em 2 WS_STATE_CLOSING (2) .IP \(em 2 WS_STATE_CLOSED (3) .PP Anything other than that should be considered an error. .SH RETURN VALUE Returns the client state or -1 if error. .SH AUTHOR Davidson Francis (davidsondfgl@gmail.com)