Send Tune OK frame.

        :param specification.Connection.Tune frame_in: Tune frame.

        :return:
497759
def _send_tune_ok(self, frame_in):
        
        self.max_allowed_channels = self._negotiate(frame_in.channel_max,
                                                    MAX_CHANNELS)
        self.max_frame_size = self._negotiate(frame_in.frame_max,
                                              MAX_FRAME_SIZE)
        LOGGER.debug(
            'Negotiated max frame size %d, max channels %d',
            self.max_frame_size, self.max_allowed_channels
        )

        tune_ok_frame = specification.Connection.TuneOk(
            channel_max=self.max_allowed_channels,
            frame_max=self.max_frame_size,
            heartbeat=self._heartbeat)
        self._write_frame(tune_ok_frame)
447067
def publish(self, msg, exchange, routing_key, mandatory=False,
                immediate=False, ticket=None):
        '''
        
        '''
        args = Writer()
        args.write_short(ticket or self.default_ticket).\
            write_shortstr(exchange).\
            write_shortstr(routing_key).\
            write_bits(mandatory, immediate)

        self.send_frame(MethodFrame(self.channel_id, 60, 40, args))
        self.send_frame(
            HeaderFrame(self.channel_id, 60, 0, len(msg), msg.properties))

        f_max = self.channel.connection.frame_max
        for f in ContentFrame.create_frames(self.channel_id, msg.body, f_max):
            self.send_frame(f)
567081
def send_frame(self, frame):
        
        packed = frame.pack()
        if self.debug:  # pragma: no cover
            self.log.debug("SEND: %r" % packed)
        self.request.sendall(packed)
1364065
def send_connection_preface
      return unless @state == :waiting_connection_preface
      @state = :connected
      emit(:frame, CONNECTION_PREFACE_MAGIC)

      payload = @local_settings.reject { |k, v| v == SPEC_DEFAULT_CONNECTION_SETTINGS[k] }
      settings(payload)
    end
586150
def tune_in(self):
        '''
        
        '''
        self._spawn_syndics()
        # Instantiate the local client
        self.local = salt.client.get_local_client(
            self.opts['_minion_conf_file'], io_loop=self.io_loop)
        self.local.event.subscribe('')

        log.debug('SyndicManager \'%s\' trying to tune in', self.opts['id'])

        # register the event sub to the poller
        self.job_rets = {}
        self.raw_events = []
        self._reset_event_aggregation()
        future = self.local.event.set_event_handler(self._process_event)
        self.io_loop.add_future(future, self.reconnect_event_bus)

        # forward events every syndic_event_forward_timeout
        self.forward_events = tornado.ioloop.PeriodicCallback(self._forward_events,
                                                              self.opts['syndic_event_forward_timeout'] * 1000,
                                                              )
        self.forward_events.start()

        # Make sure to gracefully handle SIGUSR1
        enable_sigusr1_handler()

        self.io_loop.start()
1345085
def send_frame(self, cmd, headers=None, body=''):
        
        frame = utils.Frame(cmd, headers, body)
        self.transport.transmit(frame)
816531
def get_tuning(self):
        
        if self.instrument and self.instrument.tuning:
            return self.instrument.tuning
        return self.tuning
912084
def process_frame(self, f, frame_str):
        
        frame_type = f.cmd.lower()

        if frame_type in ['disconnect']:
            return

        if frame_type == 'send':
            frame_type = 'message'
            f.cmd = 'MESSAGE'

        if frame_type in ['connected', 'message', 'receipt', 'error', 'heartbeat']:
            if frame_type == 'message':
                if f.headers['destination'] not in self.subscriptions.values():
                    return
                (f.headers, f.body) = self.notify('before_message', f.headers, f.body)
            self.notify(frame_type, f.headers, f.body)
        if 'receipt' in f.headers:
            receipt_frame = Frame('RECEIPT', {'receipt-id': f.headers['receipt']})
            lines = convert_frame(receipt_frame)
            self.send(encode(pack(lines)))
        log.debug("Received frame: %r, headers=%r, body=%r", f.cmd, f.headers, f.body)
1361365
def framers(self):
        

        f = self.default_framer()
        self._send_framer = f
        self._recv_framer = f
979614
def write_frame(self, frame_out):
        
        self.check_for_errors()
        self._connection.write_frame(self.channel_id, frame_out)
952312
def send_frame(self, frame):
        

        # Get the socket
        sock = self.manager.sock

        if not sock:
            raise ValueError("UDPTendrilManager not running")

        # Send the packet
        try:
            sock.sendto(self._send_streamify(frame), self.remote_addr)
        except Exception:
            # We're a best-effort service anyway, so ignore exceptions
            pass
98682
def send(self):
        
        self.log.info("Saying hello (%d)." % self.counter)

        f = stomper.Frame()
        f.unpack(stomper.send(DESTINATION, 'hello there (%d)' % self.counter))

        self.counter += 1        

        # ActiveMQ specific headers:
        #
        #f.headers['persistent'] = 'true'

        self.transport.write(f.pack())
806007
def write_frames(self, frames_out):
        
        self.check_for_errors()
        self._connection.write_frames(self.channel_id, frames_out)
271695
def send(self, msg):
        """"""
        assert isinstance(msg, str), "String is required"

        if self._debug:
            log.info("outgoing message: %s, %s", self.id, str(msg)[:200])

        if self.state != STATE_OPEN:
            return

        self._feed(FRAME_MESSAGE, msg)
776791
public boolean putTune(Tune tune) {
		boolean ret = containsTune(tune);
		tune.getTuneInfos().setBookInfos(getBookInfos());
		tune.getInstructions().addAll(0, getInstructions());
		m_tunes.put(tune.getReferenceNumber(), tune);
		return ret;
	}
1114810
def sync_tunables(self, vault_client):
        """"""
        if not self.config:
            return

        a_prefix = self.tune_prefix
        if self.tune_prefix:
            a_prefix = "%s/" % self.tune_prefix

        v_path = "sys/mounts/%s%s/tune" % (a_prefix, self.path)
        a_obj = self.config.copy()
        if 'description' in a_obj:
            del a_obj['description']

        t_resp = vault_client.write(v_path, **a_obj)
        if t_resp and 'errors' in t_resp and t_resp['errors']:
            e_msg = "Unable to update tuning info for %s" % self
            raise aomi_excep.VaultData(e_msg)
531726
def _publish_confirm(self, frames_out):
        
        confirm_uuid = self._channel.rpc.register_request(['Basic.Ack',
                                                           'Basic.Nack'])
        self._channel.write_frames(frames_out)
        result = self._channel.rpc.get_request(confirm_uuid, raw=True)
        self._channel.check_for_errors()
        if isinstance(result, specification.Basic.Ack):
            return True
        return False