def read_message(f, timeout=None): # warning: 'timeout' is not really reliable and should only be used # for testing. Also, it doesn't work if the file f does any buffering. if timeout is not None: import select iwtd, owtd, ewtd = select.select([f], [], [], timeout) if not iwtd: raise EOFError("timed out waiting for data") return marshal.load(f)
def read_message(f, timeout=None): # warning: 'timeout' is not really reliable and should only be used # for testing. Also, it doesn't work if the file f does any buffering. if timeout is not None: import select iwtd, owtd, ewtd = select.select([f], [], [], timeout) if not iwtd: raise EOFError("timed out waiting for data") return marshal.load(f)
def read_message(f): return marshal.load(f)
def read_message(f): return marshal.load(f)