library/src/network/httpd/BP-HTTPdWebSocketRequestHandlers.cc
// Send websocket protocol connection close frame.
Send websocket protocol connection close frame.
Send websocket protocol connection close frame .
BP_ERROR_T BP_HTTPdWebsocketSendConnectionClose
(
		P_BP_HTTPD_WEBSOCKET websocket,
		int                  additional_tcp_flags
)
{
	if(!websocket)
		return ERR_FAILURE;
	BP_HTTPD_WEBSOCKET_ENCODED_SEND_FRAME_HEADER header_to_send;
	BP_ZERO_STACK(header_to_send);
	header_to_send.fin_flag   = BP_TRUE;
	header_to_send.opcode = BP_HTTPD_WEBSOCKET_FRAME_OPCODE_CONNECTION_CLOSE;
	BP_HTTPdWebsocketEncodeSendFrameHeader(	&header_to_send	);
	BP_HTTPdWebsocketSendRaw
	(
		websocket,
		&header_to_send,
		(unsigned char *) NULL,
		0,
		BP_KILOBYTE,
		additional_tcp_flags
	);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_HTTPdWebsocketSendConnectionClose ( P_BP_HTTPD_WEBSOCKET websocket , int additional_tcp_flags ) { if ( ! websocket ) return ERR_FAILURE ; BP_HTTPD_WEBSOCKET_ENCODED_SEND_FRAME_HEADER header_to_send ; BP_ZERO_STACK ( header_to_send ) ; header_to_send . fin_flag = BP_TRUE ; header_to_send . opcode = BP_HTTPD_WEBSOCKET_FRAME_OPCODE_CONNECTION_CLOSE ; BP_HTTPdWebsocketEncodeSendFrameHeader ( & header_to_send ) ; BP_HTTPdWebsocketSendRaw ( websocket , & header_to_send , ( unsigned char * ) NULL , 0 , BP_KILOBYTE , additional_tcp_flags ) ; return ERR_SUCCESS ; }
Send websocket protocol connection close frame.
Send websocket protocol connection close frame .
// run basic checks // create a raw header to send // set fin flag // set connection close // encode the send frame header // attempt to send encoded data // return indicating success