i created a simple chat server using socket in python.
my problem is that i want the client to try connect to the server until the connection is made..(when i set the timeout of the socket)
however, when the connection fail(timeout), i did another request but it done immediately.
here is the code:
from socket import *
s = socket(AF_INET, SOCK_STREAM)
connected = False
while connected != True:
connected = True
print "could not connected to server now.. Tries to connect again.."
#rest of the code...
is there any way to reset the timeout or i have to close that socket and open new one..
by the way, only when i set the timeout of the socket it doesn't work, if i don't set the timeout of the socket, it works..