tcpsockets/server.py
def client_func(self, client: Client) -> None:
        """
        This method handles exceptions in the handler method and closes client socket after handling.
        The client_thread is created from this function
        Args:
            client(Client): The client that needs to be handled.

        Returns:
            None
        """
        try:
            self.handler(client)
        except BaseException:
            logger.log(
                f"Client from {(client.ip, client.port)} got disconnected due to an error:\n{traceback.format_exc()}")
        for index, other_clnt in enumerate(self.clients):
            if other_clnt == client:
                self.clients[index].close()
                del self.clients[index]
                logger.log(f"Client from {(client.ip, client.port)} disconnected")
                return

        This method handles exceptions in the handler method and closes client socket after handling.
        The client_thread is created from this function
        Args:
            client(Client): The client that needs to be handled.

        Returns:
            None
        
This method handles exceptions in the handler method and closes client socket after handling.
The client_thread is created from this function
This method handles exceptions in the handler method and closes client socket after handling . The client_thread is created from this function
def client_func(self, client: Client) -> None:
        try:
            self.handler(client)
        except BaseException:
            logger.log(
                f"Client from {(client.ip, client.port)} got disconnected due to an error:\n{traceback.format_exc()}")
        for index, other_clnt in enumerate(self.clients):
            if other_clnt == client:
                self.clients[index].close()
                del self.clients[index]
                logger.log(f"Client from {(client.ip, client.port)} disconnected")
                return
def client_func ( self , client : Client ) -> None : try : self . handler ( client ) except BaseException : logger . log ( f"Client from {(client.ip, client.port)} got disconnected due to an error:\n{traceback.format_exc()}" ) for index , other_clnt in enumerate ( self . clients ) : if other_clnt == client : self . clients [ index ] . close ( ) del self . clients [ index ] logger . log ( f"Client from {(client.ip, client.port)} disconnected" ) return
This method handles exceptions in the handler method and closes client socket after handling.
This method handles exceptions in the handler method and closes client socket after handling .
"""
        This method handles exceptions in the handler method and closes client socket after handling.
        The client_thread is created from this function
        Args:
            client(Client): The client that needs to be handled.

        Returns:
            None
        """
None
self
client
Client
The client that needs to be handled.
The client that needs to be handled .