擅长:python、mysql、java
<p>看来你有不同的问题。当我尝试用你的字符串发送all时,它似乎有效:</p>
<p>客户代码:</p>
<pre><code> from socket import *
s=socket(AF_INET, SOCK_STREAM)
s.connect(("localhost", 6789))
string = "This is my string\n\nAFTER_IT"
s.sendall(string)
</code></pre>
<p>服务器代码:</p>
^{pr2}$