Ai
1 Star 9 Fork 9

John Yet/rtsp_proxy_server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
udp_pipe.h 893 Bytes
一键复制 编辑 原始数据 按行查看 历史
learnhow 提交于 2020-07-21 11:31 +08:00 . 初始化第一次提交
#ifndef UDP_PIPE_H
#define UDP_PIPE_H
/**
* @brief UDP管线对象,监听指定listen端口并将所有接收到的UDP报文从send端口发送给远程主机上的dest端口
*/
class UDPPipe
{
public:
/**
* @brief UDPPipe
* @param listen_port 监听端口
* @param send_port 转发端口
* @param dest_host 目标主机地址
* @param dest_port 目标主机端口
*/
UDPPipe(int listen_port, int send_port, const char* dest_host, int dest_port);
virtual ~UDPPipe();
void Init();
static void OnRead(int fd, short what, void *cbarg);
void set_event_base(struct event_base* eb);
private:
struct event_base* eb_;
int listen_port_;
int send_port_;
int dest_port_;
char dest_host_[16];
int listen_sock_;
int send_sock_;
struct event* recv_ev_ = nullptr;
char *buf_ = nullptr;
};
#endif // UDP_PIPE_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/learnhow/rtsp_proxy_server.git
git@gitee.com:learnhow/rtsp_proxy_server.git
learnhow
rtsp_proxy_server
rtsp_proxy_server
master

搜索帮助