Exemple #1
0
 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)
Exemple #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
Exemple #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