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