摘要: 局域网的链路层传输数据的最大长度是1518bit,包括帧的头尾部长度18bit(头14+尾4),IP头部长度为20bit,TCP头尾部长度为20bit,UDP头尾部长度为8bit。 所以TCP在局域网中传输数据的最长长度=1518-18-20-20 = 1460bit,UDP传输数据的最长长度 = 阅读全文
posted @ 2024-04-17 22:11 tslam 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 装饰器实现 函数装饰器 实现单例 def singleton(cls): _instance = {} def inner(): if cls not in _instance: _instance[cls] = cls() return _instance[cls] return inner @s 阅读全文
posted @ 2024-04-17 09:30 tslam 阅读(7) 评论(0) 推荐(0) 编辑