def _set_connection(self, connection, host, port):
    if (connection is None):
        self.connection = OfflineConnection(host=host, port=port, max_buffer_size=self._max_buffer_size)
    else:
        self.connection = connection
def _set_connection(self, connection, host, port):
    if (connection is None):
        self.connection = OfflineConnection(host=host, port=port, max_buffer_size=self._max_buffer_size)
    else:
        self.connection = connection