my code fragment:
self.lok = thread.allocate_lock()
self.rep = self.sock.makefile("rw", 0)
r = self.rep.read(1)
d = App()
my objective is to first execute connect() completely, and then execute receive(), through threads.
but when this program is run, it first prints "connecting....", then receive() is executed. so i get an error at self.rep.read(1) - self.rep is None object. and strangely, after showing the error, and triggering an io error in the server, "ok" from connect() gets printed.