<p>我要执行以下简单的服务器代码:</p>
<pre><code>import socket
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 22331 # Reserve a port
s.bind((host, port)) # Bind to the port
s.listen(5) # Now wait for client connection.
while True:
c, addr = s.accept() # Establish connection with client.
print('Got connection from', addr)
c.send('Thank you for connecting')
c.close()
</code></pre>
<p>执行时出现以下错误:</p>
<pre><code>OSError: [Errno 99] Cannot assign requested address
</code></pre>
<p>为什么操作系统不能用地址绑定指定的端口?</p>