libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Enumerations | Functions
websocket.c File Reference
#include "log.h"
#include "websocket.h"
#include "response.h"
#include "types_internal.h"
#include "request.h"
#include "codecs.h"
#include "random.h"
#include "low.h"
#include <poll.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

Typedefs

typedef ssize_t( lpwriter_sig_t )(onion_request *req, const char *data, size_t len)
typedef ssize_t( lpreader_sig_t )(onion_request *req, char *data, size_t len)

Enumerations

enum  onion_websocket_flags_e { WS_FIN = 1, WS_MASK = 2 }

Functions

void onion_websocket_close (onion_websocket *ws, const char *status)
 Closes the websocket sending the close opcode (8)
void onion_websocket_set_opcode (onion_websocket *ws, onion_websocket_opcode opcode)
 Sets the opcode for the websocketThis can be called before writes to change the meaning of the write.
onion_websocket_opcode onion_websocket_get_opcode (onion_websocket *ws)
 Returns current in use opcodes.

Function Documentation

void onion_websocket_close ( onion_websocket ws,
const char *  status 
)

Closes the websocket sending the close opcode (8)

References onion_websocket_set_opcode(), onion_websocket_t::onion_websocket_write(), and OWS_CONNECTION_CLOSE.