我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用socket.TCP_MAXSEG。
def _update_tcp_mss(self, local_sock): self._tcp_mss = TCP_MSS try: tcp_mss = local_sock.getsockopt(socket.SOL_TCP, socket.TCP_MAXSEG) if tcp_mss > 500 and tcp_mss <= 1500: self._tcp_mss = tcp_mss logging.debug("TCP MSS = %d" % (self._tcp_mss,)) except: pass