-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwsclient.h
26 lines (24 loc) · 980 Bytes
/
wsclient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef WSCLIENT_H_
#define WSCLIENT_H_
/*
#include <stdint.h>
#include <pthread.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <stddef.h>
#include <stdbool.h>
*/
#define MAX_PAYLOAD_SIZE 1024
size_t _libwsclient_read(wsclient *c, void *buf, size_t length);
size_t _libwsclient_write(wsclient *c, const void *buf, size_t length);
int libwsclient_open_connection(const char *host, const char *port);
int stricmp(const char *s1, const char *s2);
void libwsclient_handle_control_frame(wsclient *c, wsclient_frame_in *ctl_frame);
void *libwsclient_run_thread(void *ptr);
void *libwsclient_handshake_thread(void *ptr);
void handle_on_data_frame_in(wsclient *c, wsclient_frame_in *pframe);
void libwsclient_send_data(wsclient *client, int opcode, unsigned char *payload, unsigned long long payload_len);
void libwsclient_send_string(wsclient *client, char *payload);
void update_wsclient_status(wsclient *c, int add, int del);
#endif /* WSCLIENT_H_ */