![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux网络编程
文章平均质量分 78
别忘了最初的自己
天秤座 乐观 低调 执着
展开
-
TCP 粘包问题处理[1] ( the solution of sticky package problem of TCP )
Because TCP is a stream protocol, so in the translation , there may have lots of sticky bags.The passage offer two method to solve this problem.1.We use the fixed length package to solve it. 2. We designed the protocol by ourselves , a struct wiht the h原创 2015-11-04 00:49:33 · 758 阅读 · 0 评论 -
回射-客户服务器 ( echo client-server ) [ Edition 1]
The simplest ech client-server model. Function : The client write something on the STDIN , and the server print them on the screen and write them back to the client.原创 2015-10-30 21:53:38 · 324 阅读 · 0 评论 -
回射-客户服务器 ( echo client-server ) [ Edition 2]
Function : This edition add the some features:1.The REUSEADDR of the server2.We use the child process to handle the muti-connection of the clients.3.When the client off the connection , the se原创 2015-10-30 22:57:36 · 396 阅读 · 0 评论 -
回射客户端服务器UDP(echo client&&server based on UDP)
Tips : The feature of UDP 1、connectionless 2、the information transmission based on massage3、unreliable transmission 4、for the most times , UDP is more efficient.Some points of UDP to be mentioned: 1、the message of UDP may lose , repeat 2、sometimes原创 2015-11-12 00:35:14 · 557 阅读 · 0 评论 -
通过poll修改最大并发数(the maximum concurrent connection improved by poll )
When we use select function to realise concurrent server , the times of concurrent connection is limited by two sides.(1) One is that the max count of a process can open is limited , but we can fix原创 2015-11-10 12:07:35 · 624 阅读 · 0 评论 -
回射客户端服务器epoll( echo client && server improved by epoll function )
select :1.The file descriptors that one process open is limited.2.FD_SETSIZE poll : The file descriptors that one process open is limited.ulimit -n number The file descriptors that the system run is limited with the memory.the common points :The k原创 2015-11-11 00:41:46 · 539 阅读 · 0 评论 -
超时设置方法( the way to set timeout )
In the connection between the server and the client. Sometimes there may have some timeout. Today , we used our own method to realise a series of timeout function , including read_timeout , write_time原创 2015-11-09 02:28:50 · 1733 阅读 · 0 评论 -
回射客户端服务器select 修改版[2]( echo client && server improved by select function)
Tips:Today , we mainly improved the code of the server , removing the fork() and let select to response the different events of readable information and connection of the client. Server(modif原创 2015-11-07 00:37:34 · 377 阅读 · 0 评论 -
回射客户端服务器select 修改版[1]( echo client && server improved by select function)
Function : Compared with the former edition , we add select function to realise I/O multiplexing which let client can monitor the standard input and readable event from the socket. We mainly changed原创 2015-11-06 00:09:53 · 303 阅读 · 0 评论 -
回射客户端服务器shutdown修改版( echo client && server improved by select shutdown )
Tips :When the client closed initially , how can we guarantee that the information that the client send can be totally received by the server.This passage mainly discuss this problem with close() and shutdown(). With the comparison , we learned that close原创 2015-11-07 11:20:56 · 351 阅读 · 0 评论 -
回射客户端服务器中僵尸进程的处理( the solution of zombie process in the echo client && server )
Tips :In the passage , we discuss how to clean up zombie processes with a better solution. We attempted signal ( SIGCHLD , SIG_IGN ), but it can't manage many son processes. The same things happened原创 2015-11-05 01:20:44 · 504 阅读 · 0 评论 -
TCP 粘包问题处理[2] ( the solution of sticky package problem of TCP )
Function : In this passage , we offer another method to set out the sticky package. The method is that we encapsulate deadline function to realise to read by line. We set '\n' as the boundary of t原创 2015-11-04 16:52:44 · 336 阅读 · 0 评论 -
点对点-客户端服务器 ( peer to peer Client & Server )
Function : 1.The client can write to the server and also the server can write to the client. 2. Client and server both of them can response to the each other's off line. (with signal designed by yourself SIGUSR1 ) Server :/*****原创 2015-10-31 01:48:38 · 1056 阅读 · 0 评论