From 120d0bd993a95c47146e9d751888dc36359e2ff4 Mon Sep 17 00:00:00 2001 From: xphi Date: Mon, 22 Feb 2021 18:39:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=8D=A2=E7=94=A8?= =?UTF-8?q?=E4=BA=86tcolorbox=20+=20minted=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/chapter1/section3.tex | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/data/chapter1/section3.tex b/data/chapter1/section3.tex index bb5ebcf..cae6bfe 100644 --- a/data/chapter1/section3.tex +++ b/data/chapter1/section3.tex @@ -471,9 +471,9 @@ CUBIC的关键特征是:cwnd窗口的增长依赖两次丢包的时间。 \subsection{附件} \label{subsec:c1_s3_additionalprg} 1. Python3 TCP socket通信程序。 + \ 服务端 server.py -\lstset{language=python3} -\begin{lstlisting} +\begin{code}[python] import socket import time def recv_data(sock,length): @@ -499,11 +499,10 @@ CUBIC的关键特征是:cwnd窗口的增长依赖两次丢包的时间。 finally: sc.close() s.close() -\end{lstlisting} -\\ -\ 客户端 client.py -\lstset{language=python3} -\begin{lstlisting} +\end{code} + +客户端 client.py +\begin{code}[python] import socket import time ip_port = ("192.168.100.144", 9999) @@ -522,4 +521,4 @@ CUBIC的关键特征是:cwnd窗口的增长依赖两次丢包的时间。 print("Sent. Waiting....") while True: time.sleep(0.001) -\end{lstlisting} \ No newline at end of file +\end{code} \ No newline at end of file