src/libs/ulfius/lib_websocket.c
/**
 * websocket_incoming_message_callback
 * Read incoming message and prints it on the console
 */
websocket_incoming_message_callback
Read incoming message and prints it on the console
websocket_incoming_message_callback Read incoming message and prints it on the console
void websocket_incoming_message_callback (const struct _u_request * request,
                                         struct _websocket_manager * websocket_manager,
                                         const struct _websocket_message * last_message,
                                         void * websocket_incoming_message_user_data) {
  if (websocket_incoming_message_user_data != NULL) {
    dbgprintf(DBG_DEBUG, "websocket_incoming_message_user_data is %s", websocket_incoming_message_user_data);
  }
  dbgprintf(DBG_DEBUG, "Incoming message, opcode: 0x%02x, mask: %d, len: %zu", last_message->opcode, last_message->has_mask, last_message->data_len);
  if (last_message->opcode == U_WEBSOCKET_OPCODE_TEXT) {
    dbgprintf(DBG_DEBUG, "text payload '%.*s'", last_message->data_len, last_message->data);
  } else if (last_message->opcode == U_WEBSOCKET_OPCODE_BINARY) {
    dbgprintf(DBG_DEBUG, "binary payload");
  }
}
void websocket_incoming_message_callback ( const struct _u_request * request , struct _websocket_manager * websocket_manager , const struct _websocket_message * last_message , void * websocket_incoming_message_user_data ) { if ( websocket_incoming_message_user_data != NULL ) { dbgprintf ( DBG_DEBUG , " " , websocket_incoming_message_user_data ) ; } dbgprintf ( DBG_DEBUG , " " , last_message -> opcode , last_message -> has_mask , last_message -> data_len ) ; if ( last_message -> opcode == U_WEBSOCKET_OPCODE_TEXT ) { dbgprintf ( DBG_DEBUG , " " , last_message -> data_len , last_message -> data ) ; } else if ( last_message -> opcode == U_WEBSOCKET_OPCODE_BINARY ) { dbgprintf ( DBG_DEBUG , " " ) ; } }
websocket_incoming_message_callback
 Read incoming message and prints it on the console
websocket_incoming_message_callback Read incoming message and prints it on the console