服务器端: #include <stdio.h> #include <unistd.h> #include <sys/socket.h> #include <stdlib.h> #include <ctype.h> #include <arpa/inet.h> #include <sys/types ...
分类:
其他好文 时间:
2020-06-03 21:59:36
阅读次数:
94
一、nginx之tcp_nopush、tcp_nodelay、sendfile 1、TCP_NODELAY你怎么可以强制 socket 在它的缓冲区里发送数据?一个解决方案是 TCP 堆栈的 TCP_NODELAY选项。这样就可以使缓冲区中的数据立即发送出去。 Nginx的 TCP_NODELAY ...
分类:
其他好文 时间:
2020-06-03 17:20:29
阅读次数:
58
异常: log4j:ERROR Could not find value for key log4j.appender.logServer.layout log4j:WARN File option not set for appender [logServer]. 2020-06-03 11:22 ...
分类:
编程语言 时间:
2020-06-03 12:00:31
阅读次数:
348
任何一个系统都需要日志记录功能,以便开发调试,线上环境追溯问题。 常用的日志记录框架Log4j。其是apache的一个开源日志组件。 #生产环境使用info #log4j.rootLogger = info,stdout,logfile #开发环境使用debug log4j.rootLogger = ...
分类:
其他好文 时间:
2020-06-03 00:58:58
阅读次数:
92
ix系统上,mysql的登陆方式有两种,分别是socket和tcp/ip方式登陆。当server和client在同一台服务器上的时候,我们可以直接用mysql命令登陆。[root@mysql ~]# mysqlWelcome to the MySQL monitor. Commands end wi ...
分类:
数据库 时间:
2020-06-03 00:48:38
阅读次数:
96
1.多进程实现并发的socket # server.py?import socketfrom multiprocessing import Processdef chat(conn): while True: try: ret = conn.recv(1024).decode('utf-8') co ...
分类:
编程语言 时间:
2020-06-03 00:27:06
阅读次数:
61
/** * 使用socket读取网页内容 */ private static void socketReadWebPage() { try { String strHost = "www.baidu.com"; InetSocketAddress socketAddress = new InetSo ...
分类:
编程语言 时间:
2020-06-02 11:32:18
阅读次数:
85
对于单机server,单机可以接受的(tcp)最大连接数是多少? socket是系统的一个操作系统句柄,不是本地端口。对于TCP链接来说,由本地的IP、PORT、远端的IP、PROT,来唯一确定一个连接,即TCP得socket。 服务器創建Socket过程:服务器创建监听socket- >与对外服务 ...
分类:
其他好文 时间:
2020-06-02 09:43:47
阅读次数:
90
java两台服务器之间,大文件上传(续传),采用了Socket通信机制以及JavaIO流两个技术点,具体思路如下: 实现思路: 1、服:利用ServerSocket搭建服务器,开启相应端口,进行长连接操作 2、服:使用ServerSocket.accept()方法进行阻塞,接收客户端请求 3、服:每 ...
分类:
编程语言 时间:
2020-06-01 13:45:51
阅读次数:
62
nginx ab并发测试 apr_socket_recv: Connection refused vim /etc/sysctl.conf net.ipv4.tcp_syncookies = 0 就可以了 ...
分类:
其他好文 时间:
2020-05-31 22:05:45
阅读次数:
245