getting error 10053 on python 2.7 -
i'm starting networks , code isn't best reason don't understand i'm getting error 10053 when i'm running client
import socket import datatime import random s_server = socket.socket() s_server.bind(('127.0.0.1', 44444)) s_server.listen(1) print "waiting" (c_socket, c_address) = s_server.accept() print "connected" c_receive = c_socket.recv(1024) time = datetime.datetime.now() if c_receive == "time": c_socket.send(time) if c_receive == "name": c_socket.send("server name kingsfall") random1 = random.random[1.0, 10.0] if c_receive == "random": c_socket.send(random1) if c_receive == "close": s_server.close() c_socket.close()
and client
import socket c_socket = socket.socket() c_socket.connect(('127.0.0.1', 44444)) c_socket.send("time") print c_socket.recv(1024) c_socket.send("random") print c_socket.recv(1024) c_socket.send("name") print c_socket.recv(1024) c_socket.send("quit") c_socket.close()
and error
line 7, in
print c_socket.recv(1024)
socket.error: [errno 10053] established connection aborted software in host machine
Comments
Post a Comment