// Send indicates an expected call of Send
976311
func (mr *MockRPCClientMockRecorder) Send(route, data interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockRPCClient)(nil).Send), route, data)
}
475997
func (c *Client) Send(msg OMessage) error {
	buf, err := json.Marshal(msg)
	if err != nil {
		return err
	}
	resp, err := c.httpclient.Post(c.Url, "application/json", bytes.NewReader(buf))
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	// Read entire body to completion to re-use keep-alive connections.
	io.Copy(ioutil.Discard, resp.Body)

	if resp.StatusCode != 200 {
		return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
	}
	return nil
}
440046
func (s *StdoutClient) send(stat string, format string, value interface{}) error {
	stat = strings.Replace(stat, "%HOST%", Hostname, 1)
	// if sending tcp append a newline
	format = fmt.Sprintf("%s%s:%s\n", s.prefix, stat, format)
	_, err := fmt.Fprintf(s.FD, format, value)
	return err
}
89484
func (c *Client) Send(b []byte) ([]byte, error) {
	c.Lock()
	defer c.Unlock()

	if err := c.w.Write(b); err != nil {
		return nil, err
	}
	return c.r.Read()
}
1318338
func (r *Response) Send(msg string) {
	r.bot.Client.Send(r, msg)
}
459203
func send(c chan result, v interface{}, e Error) {
	c <- result{v, e}
}
1126218
func (m *Messenger) Send(ctx context.Context, upid *upid.UPID, msg proto.Message) error {
	return m.Called().Error(0)
}
1124439
func (peer *Peer) send(message bytes.Buffer) (err error) {
	//Logln("Sending", message)
	Send(peer, message)
	peer.lastSent = time.Now().UnixNano()
	return nil // no error handling for now (sending is asynchronous)
}
951892
func (c *Client) Send(req *Request, res Response) error {
	// TODO: handle retry, timeouts, etc.
	return c.send(req, res)
}
301858
func (q *CtxQueue) Send(p interface{}) {
	// Make sure to lock here
	q.startC.L.Lock()

	// Context is done
	if d := atomic.LoadUint32(&q.ctxIsDone); d == 1 {
		q.startC.L.Unlock()
		return
	}

	// Check whether queue has been started
	if d := atomic.LoadUint32(&q.hasStarted); d == 0 {
		// We either wait for the queue to start or for the ctx to be done
		q.startC.Wait()

		// Context is done
		if d := atomic.LoadUint32(&q.ctxIsDone); d == 1 {
			q.startC.L.Unlock()
			return
		}
	}
	q.startC.L.Unlock()

	// Create cond
	c := sync.NewCond(&sync.Mutex{})
	c.L.Lock()

	// Send message
	q.c <- ctxQueueMessage{
		c: c,
		p: p,
	}

	// Wait for handling to be done
	c.Wait()
}
284389
func (kvmsg *Kvmsg) Send(socket *zmq.Socket) (err error) {
	//fmt.Printf("Send to %s: %q\n", socket, kvmsg.frame)
	kvmsg.encode_props()
	_, err = socket.SendMessage(kvmsg.frame)
	return
}
1132364
func (c *Client) Send(msg *Message) error {
	buf, err := json.Marshal(msg)
	if err != nil {
		return err
	}
	resp, err := c.HTTPClient.Post(c.url, "application/json", bytes.NewReader(buf))
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	// Discard response body to reuse connection
	io.Copy(ioutil.Discard, resp.Body)

	if resp.StatusCode != 200 {
		return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
	}
	return nil
}
610532
func (c *Client) send(name string, value interface{}, suffix []byte, tags []string, rate float64) error {
	if c == nil {
		return fmt.Errorf("Client is nil")
	}
	if rate < 1 && rand.Float64() > rate {
		return nil
	}
	data := c.format(name, value, suffix, tags, rate)
	return c.sendMsg(data)
}
950993
func (c *Transport) Send(ctx context.Context, messageParts ...[]byte) (<-chan Message, error) {
	conn, err := c.getConnection(ctx)
	if err != nil {
		return nil, driver.WithStack(err)
	}
	result, err := conn.Send(ctx, messageParts...)
	if err != nil {
		return nil, driver.WithStack(err)
	}
	return result, nil
}
314346
func (s *SMTP) Send(msg *Message) error {
	var conn net.Conn
	var err error
	var success bool

	recipients := msg.Recipients()
	if len(recipients) < 1 {
		return ErrNoRecipients
	}

	switch s.scheme {
	case "smtps":
		conn, err = tls.Dial("tcp", s.server, s.tlsConfig)
	case "tls":
		fallthrough
	default:
		conn, err = net.Dial("tcp", s.server)
	}
	if err != nil {
		return err
	}

	client, err := smtp.NewClient(conn, s.server)
	if err != nil {
		return err
	}
	defer func() {
		if !success {
			client.Quit()
		}
	}()

	// Send HELO/EHLO
	if err = client.Hello(s.hostname); err != nil {
		return err
	}

	// Check if STARTTLS is supported if not smtps.
	if s.scheme != "smtps" {
		hasStartTLS, _ := client.Extension("STARTTLS")
		if !hasStartTLS && s.scheme == "tls" {
			return fmt.Errorf("server does not support TLS")
		}
		if hasStartTLS {
			if err = client.StartTLS(s.tlsConfig); err != nil {
				return err
			}
		}
	}

	// Send authentication, if specified
	if s.auth != nil {
		if err = client.Auth(*s.auth); err != nil {
			return err
		}
	}

	// MAIL FROM
	if err = client.Mail(msg.From()); err != nil {
		return err
	}

	// RCPT TO
	for _, rcpt := range msg.Recipients() {
		if err = client.Rcpt(rcpt); err != nil {
			return err
		}
	}

	// DATA
	dataBuf, err := client.Data()
	if err != nil {
		return err
	}

	_, err = dataBuf.Write(msg.Body())
	dataBuf.Close()
	if err != nil {
		return err
	}

	err = client.Quit()
	if err != nil {
		return err
	}

	success = true
	return nil
}
1159000
func (c *HTTPClient) Send(req *http.Request) HTTPClientInterface {
	c.request = req
	return c
}
608114
func (c *Client) Send(data []byte) ([]byte, error) {
	if !c.running.Load() {
		panic(fmt.Sprintf("process.Client for %q has been closed", c.cmd.Path))
	}

	return c.client.Send(data)
}