28 lines
769 B
C
28 lines
769 B
C
#ifndef OMNI_SERVER_KCP_HUB_H
|
|
#define OMNI_SERVER_KCP_HUB_H
|
|
|
|
#include "transport_kcp.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct kcp_hub kcp_hub_t;
|
|
|
|
kcp_hub_t *kcp_hub_new(latency_logger_t *logger, kcp_session_stats_logger_t *stats_logger, int stats_interval_ms);
|
|
int kcp_hub_serve_listener(kcp_hub_t *hub, kcp_listener_t *listener);
|
|
int kcp_hub_serve_session(kcp_hub_t *hub, kcp_conn_t *conn);
|
|
|
|
int kcp_hub_set_relay(kcp_hub_t *hub, int relay_fd, const struct sockaddr *peer_addr, socklen_t peer_addr_len, int learn_peer);
|
|
int kcp_hub_set_telemetry(kcp_hub_t *hub, const char *peer_id, int interval_ms);
|
|
int kcp_hub_serve_relay(kcp_hub_t *hub);
|
|
|
|
int kcp_hub_close(kcp_hub_t *hub);
|
|
void kcp_hub_free(kcp_hub_t *hub);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|