日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

【WebRTC---进阶篇】(二)libevent实现高性能网络服务器

發布時間:2023/12/3 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【WebRTC---进阶篇】(二)libevent实现高性能网络服务器 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

libevent編譯與安裝

libevent官網

Linux平臺安裝編譯libevent

wget -c addr --no-check-certificate ./configure --prefix=/usr/local/libevent make -j 8 make install #include <event2/listener.h> #include <event2/bufferevent.h> #include <event2/buffer.h> #include <event2/thread.h>#include <arpa/inet.h>#include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h>static void echo_read_cb(struct bufferevent *bev, void *ctx) {/* 獲取bufferevent中的讀和寫的指針 *//* This callback is invoked when there is data to read on bev. */struct evbuffer *input = bufferevent_get_input(bev);struct evbuffer *output = bufferevent_get_output(bev);/* 把讀入的數據全部復制到寫內存中 *//* Copy all the data from the input buffer to the output buffer. */evbuffer_add_buffer(output, input); }static

總結

以上是生活随笔為你收集整理的【WebRTC---进阶篇】(二)libevent实现高性能网络服务器的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。