'Generic handler that will write to both SSH and telnet channel.'

def _write_channel(self, out_data):

    if (self.protocol == u'ssh'):
        self.remote_conn.sendall(write_bytes(out_data))
    elif (self.protocol == u'telnet'):
        self.remote_conn.write(write_bytes(out_data))
    else:
        raise ValueError(u'Invalid    protocol    specified')
    log.debug(u'write_channel:    {}'.format(write_bytes(out_data)))
