【问题标题】:getting this error " ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine"收到此错误“ ConnectionAbortedError:[WinError 10053]已建立的连接已被主机中的软件中止”
【发布时间】:2017-02-21 15:46:15
【问题描述】:

**当我在控制台中键入“dir”时,我收到此错误,错误显示此行“client_response = str(conn.recv(1024),“utf-8”)”**

def socket_accept():

conn, address = s.accept()
print("Connection has been established | " + "IP " + address[0] + "| Port " + str(address[1]))
send_commands(conn)
conn.close()


def send_commands(conn):

while True:
    cmd = input()
    if cmd == 'quit':
        conn.close()
        s.close()
        sys.exit()
    if len(str.encode(cmd)) > 0:
        conn.send(str.encode(cmd))
        client_response = str(conn.recv(1024), "utf-8")
        print(client_response, end ="")

【问题讨论】:

标签: python python-2.7 python-3.x sockets websocket


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2019-01-04
    • 1970-01-01
    • 2020-05-22
    • 1970-01-01
    • 2018-12-12
    • 2021-02-02
    • 2019-06-25
    • 1970-01-01
    • 2021-11-12
    相关资源
    最近更新 更多