随笔分类 -  网络编程

摘要:Server: 1 from flask import Flask, request, jsonify 2 import json 3 import re 4 import os 5 import subprocess 6 7 conf_file_src = '/etc/nginx/nginx.co 阅读全文
posted @ 2020-07-27 23:34 wa小怪兽 阅读(234) 评论(0) 推荐(0)
摘要:状态机: bbr算法主要流程: 代码: 1 /* Bottleneck Bandwidth and RTT (BBR) congestion control 2 * 3 * BBR congestion control computes the sending rate based on the d 阅读全文
posted @ 2020-07-20 20:08 wa小怪兽 阅读(2800) 评论(4) 推荐(0)
摘要:在调试时服务器程序会不断重启,由于TCP的四次挥手机制,结束程序后2MSL的时间内无法再次绑定该端口。可以对监听fd设置SO_REUSEADDR和SO_REUSEPORT标志,立即回收端口号。 int optval = 1; setsockopt(fdServer, SOL_SOCKET, SO_R 阅读全文
posted @ 2020-06-03 22:09 wa小怪兽 阅读(125) 评论(0) 推荐(0)
摘要:把自己的项目部署到阿里云ecs服务器之后,只有127.0.0.1才能连接到服务器端,检查了阿里云安全组规则,以及socket绑定的地址无误后,发现没有开启服务器防火墙的对应端口。 firewall-cmd --add-port=[端口号]/tcp --permanent firewall-cmd - 阅读全文
posted @ 2019-12-04 13:23 wa小怪兽 阅读(1458) 评论(0) 推荐(0)
摘要:SockClient.h #pragma once #include<functional> #define _WINDOWS #ifdef _WINDOWS #define _WINSOCK_DEPRECATED_NO_WARNINGS #ifndef _WINSOCK2_H #include<W 阅读全文
posted @ 2019-11-06 15:18 wa小怪兽 阅读(224) 评论(0) 推荐(0)
摘要:#pragma once #ifndef WINSOCK2_H #define _WINSOCK_DEPRECATED_NO_WARNINGS #include<WinSock2.h> #include<Windows.h> #pragma comment(lib, "ws2_32.lib") #e 阅读全文
posted @ 2019-10-08 16:28 wa小怪兽 阅读(339) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 int main(int argc,char *argv[]) 10 { 11 int s; 12 struct sockaddr_in server_addr; 13 ... 阅读全文
posted @ 2018-10-17 18:52 wa小怪兽 阅读(1020) 评论(0) 推荐(0)
摘要:Server: Client: 阅读全文
posted @ 2018-10-17 17:58 wa小怪兽 阅读(458) 评论(0) 推荐(0)