On Message TX Initialization

Called when the message is ready to be transmit.  

Prototype

          CPU_INT32U HTTPc_WebSockOnMsgTxInit (HTTPc_CONN_OBJ            *p_conn,
                                               HTTPc_WEBSOCK_MSG_OBJ     *p_msg);


Arguments

p_conn

Pointer to the current HTTPc Connection Object.

p_msg

Pointer to the WebSocket Message to transmit 

Return Values

The length of the message to transmit.

Required Configuration

Notes / Warnings

  • When the dynamic mode is used, thus the total message length is unknown,  the value returned will be HTTPc_WEBSOCK_TX_MSG_LEN_NOT_DEFINED.  
  • This hook is set in a HTTPc_WEBSOCK_MSG_OBJ using HTTPc_WebSockMsgSetParam() with the parameter HTTPc_PARAM_TYPE_WEBSOCK_MSG_ON_MSG_TX_INIT.
  • Must be set to the HTTPc_WEBSOCK_MSG_OBJ before upgrading the connection with HTTPc_WebSockSend.