Пример #1
0
Файл: core.py Проект: svinota/cx
 def serve(self):
     """
     9p server
     """
     libc.listen(self.fd,10)
     while True:
         sa = sockaddr_in()
         s = libc.accept(self.fd, byref(sa), byref(c_uint32(sizeof(sa))))
         (l,msg) = self.recv(s)
         print("got message of",l,"bytes")
         print(msg)
         libc.close(s)
Пример #2
0
 def serve(self):
     """
     9p server
     """
     libc.listen(self.fd,10)
     self.closed = False
     while True:
         sa = sockaddr_in()
         try:
             s = libc.accept(self.fd, byref(sa), byref(c_uint32(sizeof(sa))))
             p9session(self, s).start()
         except:
             self.close()
             raise
Пример #3
0
 def serve(self):
     """
     9p server
     """
     libc.listen(self.fd, 10)
     self.closed = False
     while True:
         sa = sockaddr_in()
         try:
             s = libc.accept(self.fd, byref(sa),
                             byref(c_uint32(sizeof(sa))))
             p9session(self, s).start()
         except:
             self.close()
             raise