ソースを参照

removed deprecated code

digital 7 年 前
コミット
835f4bbd90
1 ファイル変更0 行追加33 行削除
  1. 0 33
      network/__init__.py

+ 0 - 33
network/__init__.py

@@ -224,13 +224,6 @@ class Server(object):
         self.handle_tasks = curio.TaskGroup(name="tg_handle_clients")
         # list of all active connection handlers
         self.connection_handler = []
-        # these aren't actually used, I will remove them soon
-        # self.conn_to_addr = {}
-        # self.addr_to_conn = {}
-        # self.conn_to_handler ={}
-        # self.handler_to_conn = {}
-        # this was used for the select.select approach. we use the async approach now, let's remove it
-        # self.read_sockets_expected = [self.socket]
         # register our cleanup method to be executed when the program exits.
         # the cleanup function unregisters itself, so it won't get executed twice when the user called it befor the program exites
         atexit.register(self.shutdown)
@@ -261,32 +254,6 @@ class Server(object):
         """
         return self.handler_class(conn, addr, self, **self.handler_kwargs)
 
-    # DEPRECATED
-    # def register_conn(self, conn, addr):
-    #     # if self.log_ip:
-    #     #     lserver.info("New connection from {} on port {}".format(*addr))
-    #     self.read_sockets_expected.append(conn)
-    #     if addr:
-    #         self.conn_to_addr[conn] = addr
-    #         self.addr_to_conn[addr] = conn
-    #
-    # def unregister_conn(self, conn):
-    #     self.read_sockets_expected.remove(conn)
-    #     addr = self.conn_to_addr.get(conn, False)
-    #     if addr:
-    #         del self.addr_to_conn[addr]
-    #         del self.conn_to_addr[conn]
-    #
-    # def register_handler(self, handler, conn):
-    #     self.connection_handler.append(handler)
-    #     self.conn_to_handler[conn] = handler
-    #     self.handler_to_conn[handler] = conn
-    #
-    # def unregister_handler(self, handler, conn):
-    #     self.connection_handler.remove(handler)
-    #     del self.conn_to_handler[conn]
-    #     del self.handler_to_conn[handler]
-
     def setup(self):
         """
         creates a scoket, opens the connection and starts listening for