源码之家

  • 首页
  • 文章
  • 问答
  • 下载
您的位置: 首页  >  文章  >  python网络编程---服务端socketserver

python网络编程---服务端socketserver

分类: 文章 • 2022-08-13 21:50:23

1.导入socketserver,ThreadingTCPServer支持多client连接

import socketserver
class Mysocket(socketserver.BaseRequestHandler):
        def handle(self):
                    while True:
                            try:
                                    pass
                            except ConnectionResetError as e:
                                    print(e)

if __name__=="__main__":
    Host,port='localhost',8989
    server=socketserver.ThreadingTCPServer((Host, port), Mysocket)
    server.serve_forever()

相关推荐

  • python网络编程(线程)
  • python笔记系列-day22:网络编程socket
  • 第一章 神经网络如何工作(附Python神经网络编程.pdf)
  • 《Python神经网络编程》第一章难点理解
  • 10.python网络编程(解决粘包问题 part 2)
  • 10.python网络编程(socket server 实现并发 part 2)
  • Python网络编程学习笔记之数据链路层与ARP
  • python 网络编程 问题记录
  • python-网络安全编程第八天(实战高精度密码字典生成器)
  • 【Python基础】网络编程之TCP 网络应用程序开发流程
  • python开发mongodb启动脚本
  • 如何在postgresql中使用循环函数
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 源码之家    备案号:   粤ICP备20058927号