nopoll_bool nopoll_conn_is_ok ( noPollConn conn)

Allows to check if the provided connection is in connected state (just to the connection).

This is different to be ready to send and receive content because the session needs to be first established.

You can use nopoll_conn_is_ready to ensure the connection is ready to be used (read or write operation can be done because handshake has finished).

For example, you might connect to a raw socket server and nopoll_conn_is_ok will report that everything is ok because the socket is indeed connected but because you are connecting to a non-websocket server, it will not work because the WebSocket session establishment didn't take place and hence nopoll_conn_is_ready will fail.

Please, see the following link for a complete example that connects and ensure the connection is ready (for a client):

connThe websocket connection to be checked.
nopoll_true in the case the connection is working otherwise nopoll_false is returned.

References nopoll_false.

Referenced by nopoll_conn_get_msg(), nopoll_conn_read(), and nopoll_conn_wait_until_connection_ready().