// sendBinlogDumpCommand is part of the Flavor interface.
341744
func (mysqlFlavor) sendBinlogDumpCommand(c *Conn, slaveID uint32, startPos Position) error {
	gtidSet, ok := startPos.GTIDSet.(Mysql56GTIDSet)
	if !ok {
		return vterrors.Errorf(vtrpc.Code_INTERNAL, "startPos.GTIDSet is wrong type - expected Mysql56GTIDSet, got: %#v", startPos.GTIDSet)
	}

	// Build the command.
	sidBlock := gtidSet.SIDBlock()
	return c.WriteComBinlogDumpGTID(slaveID, "", 4, 0, sidBlock)
}
607173
func (mc *mysqlConn) writeCommandPacket(command byte) error {
	// Reset Packet Sequence
	mc.sequence = 0

	data, err := mc.buf.takeSmallBuffer(4 + 1)
	if err != nil {
		// cannot take the buffer. Something must be wrong with the connection
		errLog.Print(err)
		return errBadConnNoWrite
	}

	// Add command byte
	data[4] = command

	// Send CMD packet
	return mc.writePacket(data)
}
270519
func SendAppLog(appID, message, sourceType, sourceInstance string) error {
	if logSender == nil {
		return nil
	}
	return logSender.SendAppLog(appID, message, sourceType, sourceInstance)
}
797372
func (m *MMClient) SendDirectMessage(toUserId string, msg string, rootId string) { //nolint:golint
	m.SendDirectMessageProps(toUserId, msg, rootId, nil)
}
94971
func (self *SocketHandler) sendUDP(bin []byte) error {
	if self.conn == nil {
		err := self.createSocket()
		if err != nil {
			return err
		}
	}
	_, err := self.conn.Write(bin)
	return err
}
605522
func (d *logDrain) Send(message string) error {
	if d.muted {
		return nil
	}
	d.mutex.Lock()
	defer d.mutex.Unlock()
	conn, err := d.getConnection(false)
	if err != nil {
		return err
	}
	_, err = fmt.Fprintln(conn, message)
	if err != nil {
		// Try again with a new connection in case the issue was a broken pipe
		conn, err = d.getConnection(true)
		if err != nil {
			return err
		}
		_, err = fmt.Fprintln(conn, message)
		if err != nil {
			return err
		}
	}
	return nil
}
434846
func (c *Controller) sendCommand(command string) (int, string, error) {
	if err := c.conn.Writer.PrintfLine(command); err != nil {
		return 0, "", err
	}

	// We'll use ReadResponse as it has built-in support for multi-line
	// text protocol responses.
	code, reply, err := c.conn.Reader.ReadResponse(success)
	if err != nil {
		return code, reply, err
	}

	return code, reply, nil
}
1263690
func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage {
	var pm *string = nil
	if parsemode != nil {
		pmt := parsemode.String()
		pm = &pmt
	}
	payload := QuerySendMessage{cid, text, pm, dwp, rtmid, rm}
	return bot.SendMessageQuery(payload)
}
103286
func (bot TgBot) SendVoiceWithKeyboardHide(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage {
	var rkm ReplyMarkupInt = rm
	return bot.SendVoice(cid, audio, duration, rmi, &rkm)
}
795015
func (worker *Worker) Send(command, option string, msg []string) (err error) {
	n := 4
	if option != "" {
		n++
	}
	m := make([]string, n, n+len(msg))
	m = append(m, msg...)

	//  Stack protocol envelope to start of message
	if option != "" {
		m[4] = option
	}
	m[3] = command
	m[2] = mdapi.MDPW_WORKER

	//  Stack routing envelope to start of message
	m[1] = ""
	m[0] = worker.identity

	if worker.broker.verbose {
		log.Printf("I: sending %s to worker %q\n", mdapi.MDPS_COMMANDS[command], m)
	}
	_, err = worker.broker.socket.SendMessage(m)
	return
}
1222389
func NewSendCommandOption() *SendCommandOption {
	return &SendCommandOption{
		UseUSKeyboard:  false,
		Debug:          false,
		ProgressWriter: ioutil.Discard,
	}
}
1357172
func (c *Client) SendDef(def *Synthdef) error {
	db, err := def.Bytes()
	if err != nil {
		return err
	}
	msg := osc.Message{
		Address: synthdefReceiveAddress,
		Arguments: osc.Arguments{
			osc.Blob(db),
		},
	}
	if err := c.oscConn.Send(msg); err != nil {
		return err
	}
	var done osc.Message
	select {
	case done = <-c.doneChan:
		goto ParseMessage
	case err = <-c.errChan:
		return err
	}

ParseMessage:
	// error if this message was not an ack of the synthdef
	errmsg := "expected /done with /d_recv argument"
	if len(done.Arguments) != 1 {
		return fmt.Errorf(errmsg)
	}
	addr, err := done.Arguments[0].ReadString()
	if err != nil {
		return err
	}
	if addr != synthdefReceiveAddress {
		return errors.New(errmsg)
	}
	return nil
}
692491
func (c *Conn) Send(commandName string, args ...interface{}) error {
	c.queue = append(c.queue, queueElement{
		commandName: commandName,
		args:        args,
	})
	return nil
}
207589
func logCallback(a *C.utp_callback_arguments) C.uint64 {
	Logger.Printf("libutp: %s", C.GoString((*C.char)(unsafe.Pointer(a.buf))))
	return 0
}
508201
func (p *DNSProxy) sendRefused(scopedLog *logrus.Entry, w dns.ResponseWriter, request *dns.Msg) (err error) {
	refused := new(dns.Msg)
	refused.SetRcode(request, p.rejectReply)

	if err = w.WriteMsg(refused); err != nil {
		scopedLog.WithError(err).Error("Cannot send REFUSED response")
		err = fmt.Errorf("cannot send REFUSED response: %s", err)
	}
	return err
}
808328
func (d *Driver) SendCommand(cmd string) (err error) {
	_, err = d.cmdConn.Write([]byte(cmd))
	return
}
349103
func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage {
	var rkm ReplyMarkupInt = rm
	return bot.SendMessage(cid, text, parsemode, dwp, rtmid, &rkm)
}