def METHOD_NAME(self, json: str):
    if (hasattr(self, 'conn')):
        try:
            self.conn.send(str(json).encode())
        except Exception as err:
            print('tcpServer sendMessage: ' + err)