摘要:
1.select模型 //selectServer.cpp #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/sock 阅读全文
摘要:
//mthserver.cpp #include "TcpServer.h" #include "CLogFile.h" #include <string> #include <pthread.h> #include <vector> CLogFile logfile; TcpServer tcpS 阅读全文
摘要:
开辟进程会分配新的地址空间,系统开销高。 每个进程可以有很多线程,同个进程的线程共享地址空间,共享全局变量和对象,系统开销较低。 头文件 #include <pthread.h> pid类型 pid类型pthread_t,实质是unsigned long int,一串长长的无符号整数 链接 要指定p 阅读全文
摘要:
#include "TcpServer.h" #include "CLogFile.h" CLogFile logfile; TcpServer tcpServer; void FatherEXIT(int sig) { if(sig>0) { signal(sig,SIG_IGN); signal 阅读全文
摘要:
把socket的一些函数封装 //TcpClient.h #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socke 阅读全文
摘要:
1. 信号 后台服务程序要脱离shell运行,可用2种方法: 后台运行:demo & fork一个子进程,再终止父进程,从而让子进程被系统托管(ppid=1) 终止进程时,在shell下可以ctrl-c、kill pid、killall demo。 这三个都是给系统给demo程序发送了信号,ctrl 阅读全文
摘要:
import pprint import requests import json import re import os # 最大删除条数 MAX_COUNT = 200 # 保存cookie的路径 COOKIE_FILE_PATH = r"./cookie.txt" class BWebSite 阅读全文
摘要:
#include <iostream> #include <mutex> #include <queue> #include <vector> #include <functional> #include <condition_variable> #include <atomic> #include 阅读全文
摘要:
DevExpress中可用separatorControl 阅读全文