一、tcp编程

(1)tcp服务器流程

Chapter23 python进阶——TCP编程

Chapter23 python进阶——TCP编程

 

 

(2)一对一:

Chapter23 python进阶——TCP编程

Chapter23 python进阶——TCP编程

 

(3)一对多(用多进程或多线程)

①如果不用多进程或多线程,当然可以用单进程服务器

Chapter23 python进阶——TCP编程

②单进程服务器-select版

Chapter23 python进阶——TCP编程

Chapter23 python进阶——TCP编程

③单进程服务器——epoll版

epoll方法只能在linux下使用

Chapter23 python进阶——TCP编程

Chapter23 python进阶——TCP编程

Chapter23 python进阶——TCP编程

 

相关文章: