I established a TCP client server connection in python where the server sends code to the client and the client evaluates the code sent.The code is sent from a file in the server. While runnig the code, it works fine at times, but at times the client code doesn't work.. It gets stuck.. Is it some problem with the network connection or the ports? But if so, how does it work at other times?
server side sending code(being read from a .py file)
info = finp.readlines()
for line in info:
self.channel.send(line)
self.channel.send("#p")
client side receiving code
while b!="#p":
b=client.recv(1024)
print >>fout, b
fout.close()
client.close()
I am reading the data from a file in the server side, sending it over the network and storing it into another .py file on the client side. This runs properly at times, but at times it gets stuck.