
linux
Pejay23
这个作者很懒,什么都没留下…
展开
-
Libevent 事件过滤器
#include "event2/listener.h" #include <error.h> #include <string.h> #include "event.h" #include <arpa/inet.h> #include <stdlib.h> #include <sys/socket.h> #include <event2/bufferevent.h> #include <event2/bufferevent_st原创 2021-01-02 22:47:37 · 196 阅读 · 0 评论 -
bufferevent客户端发送文件并处理超时和断开事件
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <str原创 2021-01-01 22:32:27 · 640 阅读 · 0 评论 -
Libevent学习笔记 服务器 接受 和相应超时断开链接操作
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <st.原创 2020-12-31 20:08:31 · 1108 阅读 · 1 评论 -
libevent 读取用户登陆日志文件并监听文件更新
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <st.原创 2020-12-31 11:11:32 · 215 阅读 · 0 评论 -
libevent学习笔记 定时器使用
#include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <error.h> #include <string.h> #include <stdlib.h> #include <signal.h> #include <event.h> #include <event2/event-config.h> #include <原创 2020-12-31 10:08:53 · 136 阅读 · 0 评论 -
libevent在 Linux 下信号 事件处理 源码学习
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/wait.h> #include <errno.h> #include <string.h> #include <time..原创 2020-12-30 20:04:25 · 180 阅读 · 0 评论 -
Linux libevent设置网络模型 配置特征
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/wait.h> #include <errno.h> #include <string.h> #include <time..原创 2020-12-30 14:42:46 · 202 阅读 · 0 评论 -
Linux 下动态库加载不上来的解决办法
gedit /etc/ldsoconf 添加动态库的绝对路径 sudo ldconfig原创 2020-09-08 09:23:28 · 457 阅读 · 0 评论 -
Linux 开发 静态库制作
静态库 lib库的名字.a 动态库 lib库的名字.so 源代码.c .cpp .h 将.c文件生成.o gcc a.c b.c -c 将.o打包 ar rcs libtest.a a.o b.o nm libtest.a 查看静态库 发布使用 -L ./include -ltest -o app(生成的名字) -I(大写的i)指定头文件的路径 ...原创 2020-12-29 09:26:47 · 113 阅读 · 0 评论 -
Qt 画圆形进度条 工作例子
void CKMMain_Set_System_Page::paintEvent(QPaintEvent *) { QPainter p(this); p.setRenderHint(QPainter::Antialiasing); double percent = (iremain * 1.0f) / itotal; int m_rotateAngle = 360*iremain/itotal; int side = qMin(width(), height())原创 2020-12-28 17:26:59 · 306 阅读 · 0 评论 -
libevent 学习笔记
#include "event2/listener.h" #include <error.h> #include <string.h> #include <arpa/inet.h> #include <stdlib.h> #include <sys/socket.h> //回调函数 void listencallback(struct evconnlistener *a1, evutil_socket_t fd, struct sockaddr原创 2020-12-27 10:18:12 · 1041 阅读 · 4 评论 -
epoll 网络模型 学习代码
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/wait.h> #include <errno.h> #include <string.h> #include <time.h原创 2020-12-24 17:49:37 · 208 阅读 · 1 评论 -
Select 网络模型
maxfd 最大描述符加1 fd_set操作集合 #include <sys/select.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> int select(int maxfdp, fd_set *readset, fd_set *writeset, fd_set *exceptset,struct timeval *timeout); maxfdp:被监听的文件描原创 2020-12-24 16:03:50 · 244 阅读 · 0 评论 -
UDP 通信例程
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <strings.h> #include <sys/wait.h> #include <errno.h> #include <string.h> #include <time.h原创 2020-12-23 14:52:57 · 351 阅读 · 0 评论 -
2020-12-23
多进程并发服务器原创 2020-12-23 00:32:43 · 125 阅读 · 0 评论 -
Linux 开发 进程间通信 消息队列学习笔记
#include "sys/types.h" #include <signal.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/msg.h> #include <string.h> struct msgbuf { long原创 2020-12-22 13:59:06 · 135 阅读 · 0 评论 -
共享内存 进程间通信
kill SIGKILL raise 向自己的进程发送函数 SIGALRM 不是立马发送 是定时等待发出 定时一段时间才发信号 只能发送给当前进程 和raise 一样 uint alarm(uint second)没有告诉内核发送什么信号 让内核延迟second 的时间再发送 发送给当前进程 在信号接受前进程不能结束 收到信号终止进程 信号的接收 sleep pause 当前进程处于睡眠状态 ctrl +Z SIGTSTP ctrl +c 键盘驱动来发送 SIGINT 信号在用用户输入 字符Ctrl+c原创 2020-12-21 20:56:54 · 260 阅读 · 0 评论 -
无名管道
```cpp #include "unistd.h" #include "stdio.h" #include "stdlib.h" int main() { int ret; int fd[2]; char buf[]="hello linux\n"; char readbuf[128]={0}; ret=pipe(fd); if(ret<0) { printf("create pipe failure."); .原创 2020-12-21 08:39:37 · 116 阅读 · 0 评论