I'm using a python socket as a file to talk to another process:
def connect(self):
try:
self.sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect( (self.target, self.port) )
self.fobj = self.sock.makefile()
Normally I'd write a command through the socket and expect a reply within a certain period. So my question is: is there a way to achieve timeout when reading a line from the socket file object?
Thanks,