摘要: 1.select模型 //selectServer.cpp #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/sock 阅读全文
posted @ 2024-07-15 17:51 徘徊彼岸花 阅读(1) 评论(0) 推荐(0) 编辑
摘要: //mthserver.cpp #include "TcpServer.h" #include "CLogFile.h" #include <string> #include <pthread.h> #include <vector> CLogFile logfile; TcpServer tcpS 阅读全文
posted @ 2024-07-10 00:40 徘徊彼岸花 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 开辟进程会分配新的地址空间,系统开销高。 每个进程可以有很多线程,同个进程的线程共享地址空间,共享全局变量和对象,系统开销较低。 头文件 #include <pthread.h> pid类型 pid类型pthread_t,实质是unsigned long int,一串长长的无符号整数 链接 要指定p 阅读全文
posted @ 2024-07-09 18:53 徘徊彼岸花 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #include "TcpServer.h" #include "CLogFile.h" CLogFile logfile; TcpServer tcpServer; void FatherEXIT(int sig) { if(sig>0) { signal(sig,SIG_IGN); signal 阅读全文
posted @ 2024-07-04 01:56 徘徊彼岸花 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 把socket的一些函数封装 //TcpClient.h #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socke 阅读全文
posted @ 2024-06-28 23:09 徘徊彼岸花 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1. 信号 后台服务程序要脱离shell运行,可用2种方法: 后台运行:demo & fork一个子进程,再终止父进程,从而让子进程被系统托管(ppid=1) 终止进程时,在shell下可以ctrl-c、kill pid、killall demo。 这三个都是给系统给demo程序发送了信号,ctrl 阅读全文
posted @ 2024-06-26 00:21 徘徊彼岸花 阅读(3) 评论(0) 推荐(0) 编辑
摘要: import pprint import requests import json import re import os # 最大删除条数 MAX_COUNT = 200 # 保存cookie的路径 COOKIE_FILE_PATH = r"./cookie.txt" class BWebSite 阅读全文
posted @ 2024-05-12 14:33 徘徊彼岸花 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <mutex> #include <queue> #include <vector> #include <functional> #include <condition_variable> #include <atomic> #include 阅读全文
posted @ 2024-05-08 03:34 徘徊彼岸花 阅读(10) 评论(0) 推荐(0) 编辑
摘要: DevExpress中可用separatorControl 阅读全文
posted @ 2023-08-08 11:12 徘徊彼岸花 阅读(0) 评论(0) 推荐(0) 编辑
摘要: ## ?. 可为null的类型访问成员时,若为null则返回null,非null时访问并返回成员。 ## ?? a??b 若a为null,则返回b。若a非null,则返回a。 ## int? 值类型可null ## a>b?val1:val2 阅读全文
posted @ 2023-07-06 12:29 徘徊彼岸花 阅读(11) 评论(0) 推荐(0) 编辑