示例#1
0
 def putc(data, timeout=10):
     try:
         size = scheduler.iotimeout(sys.stdout.write, (data,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
示例#2
0
 def getc(size, timeout=10):
     try:
         data = scheduler.iotimeout(sys.stdin.read, (size,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return data
示例#3
0
 def putc(self, data, timeout=10):
     try:
         size = scheduler.iotimeout(self.stream.write, (data,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
示例#4
0
 def putc(data, timeout=10):
     try:
         size = scheduler.iotimeout(sys.stdout.write, (data, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
示例#5
0
 def getc(size, timeout=10):
     try:
         data = scheduler.iotimeout(sys.stdin.read, (size, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return data
示例#6
0
 def putc(self, data, timeout=10):
     try:
         size = scheduler.iotimeout(self.stream.write, (data, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size