-
Notifications
You must be signed in to change notification settings - Fork 21
/
proxy_cluster.h
36 lines (29 loc) · 1.03 KB
/
proxy_cluster.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
27
28
29
30
31
32
33
34
35
36
#ifndef PROXY_CLUSTER_H
#define PROXY_CLUSTER_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
struct ntrip_proxy;
// read from ntripproxy, nonblocking
int ntripproxy_read(struct ntrip_proxy *proxy, void *buf, size_t size);
// write to ntripproxy, nonblocking
int ntripproxy_write(struct ntrip_proxy *proxy, const void *data, size_t size);
// get path of ntripproxy, return str is bound to proxy, DO NOT free it or modity it
const char * ntripproxy_get_path(struct ntrip_proxy *proxy);
// init proxycluster module, return 0 means OK, -1 means error
int proxycluster_init();
// get total proxy's count
int proxycluster_capacity_count();
// get using proxy's count
int proxycluster_using_count();
// try to take an proxy with port and mnt, NULL mean cannot get one
struct ntrip_proxy * proxycluster_take_proxy(int port, const char *mnt);
// free usage of the proxy
void proxycluster_release_proxy(struct ntrip_proxy *proxy);
// cleanup proxycluster module
void proxycluster_cleanup();
#ifdef __cplusplus
}
#endif
#endif // PROXY_CLUSTER_H