我对我的英语很抱歉,但是我的软件有些问题,我需要一些帮助。但首先,一些代码!在
客户端:
if connessione.connect(host, port) == True:
connect = True
print 'connection granted'
else:
connect = False
print 'connection refused'
while 1:
do_some_stuff_with_socket
if connect == False:
if connessione.connect(host, port) == True:
connect = True
服务器端:(在互联网上找到)
^{pr2}$如果重新启动/断开服务器,则客户端不会重新连接。我使用了.terminate()
和.close()
方法来关闭套接字。在
我通过在
.connect(host, port)
之前调用.__init__()
方法解决了我的问题它不优雅,但很管用。在
感谢大家
相关问题 更多 >
编程相关推荐