https://gist.github.com/mjm918/61f96f3346a0e3ae10d8cd48a90ebad6
我在ubuntu服务器上尝试了此代码,我想尝试在一台计算机上的2个ubuntu之间进行套接字编程。对于客户端,我在虚拟框中使用ubuntu,作为服务器,我在Google Cloud上创建的虚拟机中使用ubuntu。但是当我运行它时,这两个ubuntu都出现错误。这是错误
在虚拟机(服务器)中:
`Traceback (most recent call last):
File "server128.py", line 180, in <module>
server.bind((host, port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
在虚拟盒子(客户端)中:
Traceback (most recent call last):
File "client128.py", line 95, in <module>
fGet = server.recv(4072)
socket.error: [Errno 104] Connection reset by peer
我该怎么办?