int nopoll_conn_send_text_fragment ( noPollConn conn,
const char *  content,
long  length 
)

Allows to send an UTF-8 text (op code 1) message over the provided connection with the provided length but flagging the frame sent as not complete (more frames to come, that is, FIN = 0).

Parameters
connThe connection where the message will be sent.
contentThe content to be sent (it should be utf-8 content or the function will fail).
lengthAmount of bytes to take from the content to be sent. If provided -1, it is assumed you are passing in a C-like string nul terminated, so, that's the content to be sent.
Returns
The number of bytes written otherwise < 0 is returned in case of failure. The function will fail if some parameter is NULL or undefined, or the content provided is not UTF-8. In the case of failure, also check errno variable to know more what went wrong.

See 2.1. Retrying failed write operations to know more about error codes and when it is possible to retry write operations.

The function returns the number of bytes sent, being the max amount of bytes that can be reported as sent by this funciton. This means value reported by this function do not includes headers. The funciton also returns the following general indications:

N : number of bytes sent (user land bytes sent, without including web socket headers). 0 : no bytes sent (see errno indication). See also nopoll_conn_complete_pending_write -1 : failure found -2 : retry operation needed (NOPOLL_EWOULDBLOCK)

References nopoll_false, and NOPOLL_TEXT_FRAME.