PageRenderTime 573ms CodeModel.GetById 234ms app.highlight 12ms RepoModel.GetById 224ms app.codeStats 0ms

/websocket.h

http://github.com/nicolasff/webdis
C++ Header | 30 lines | 22 code | 8 blank | 0 comment | 0 complexity | e1f66ad7a10d7f667f017b454783c0a3 MD5 | raw file
 1#ifndef WEBSOCKET_H
 2#define WEBSOCKET_H
 3
 4#include <stdlib.h>
 5#include <stdint.h>
 6
 7struct http_client;
 8struct cmd;
 9
10enum ws_state {
11	WS_ERROR,
12	WS_READING,
13	WS_MSG_COMPLETE};
14
15struct ws_msg {
16	char *payload;
17	size_t payload_sz;
18	size_t total_sz;
19};
20
21int
22ws_handshake_reply(struct http_client *c);
23
24enum ws_state
25ws_add_data(struct http_client *c);
26
27int
28ws_reply(struct cmd *cmd, const char *p, size_t sz);
29
30#endif