问答详情
源自:2-3 网络套接字与通信过程

无法连接。


C:\Users\ASUS\venv\Scripts\python.exe "E:\JetBrains\PyCharm 2019.1.1\helpers\pydev\pydevconsole.py" --mode=client --port=52410

import sys; print('Python %s on %s' % (sys.version, sys.platform))

sys.path.extend(['C:\\Users\\ASUS', 'C:/Users/ASUS'])

PyDev console: starting.

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32

runfile('C:/Users/ASUS/Desktop/text/源代码/HTTP服务器开发/client.py', wdir='C:/Users/ASUS/Desktop/text/源代码/HTTP服务器开发')

Traceback (most recent call last):

  File "<input>", line 1, in <module>

  File "E:\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile

    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script

  File "E:\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile

    exec(compile(contents+"\n", file, 'exec'), glob, loc)

  File "C:/Users/ASUS/Desktop/text/源代码/HTTP服务器开发/client.py", line 20, in <module>

    client()

  File "C:/Users/ASUS/Desktop/text/源代码/HTTP服务器开发/client.py", line 12, in client

    s.connect((HOST,PORT))

ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。



提问者:八月未央卅 2019-09-06 18:47

个回答

  • 咚咚呛
    2019-09-06 23:50:59

    同学运行server端了吗?

  • 慕少1263319
    2020-01-31 19:56:30

    貌似我跟你一样,据说先要运行服务器,但是没有任何反应,直接把终端卡死了。