// SendTo sends a packet to the given address.
973761
func (conn *UDPConn) SendTo(addr net.Addr, p Packet) error {
	_, err := conn.WriteTo(p.Bytes(), addr)
	return err
}
953128
func (msg Message) WriteTo(w io.Writer) (int64, error) {
	var bytesWritten int

	nw, err := fmt.Fprintf(w, "%s%s", msg.Address, msg.Typetags())
	if err != nil {
		return 0, err
	}
	bytesWritten += nw

	for _, a := range msg.Arguments {
		nw, err := a.WriteTo(w)
		if err != nil {
			return 0, err
		}
		bytesWritten += int(nw)
	}

	return int64(bytesWritten), nil
}
1158459
func (b *ByteBuffer) WriteTo(w io.Writer) (int64, error) {
	b.Lock()
	defer b.Unlock()
	return b.b.WriteTo(w)
}
75773
func (e *Error) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, e.Type, e.Code, e.Data)
}
372442
func (s *sender) sendAck() {
	s.sendSegment(buffer.VectorisedView{}, header.TCPFlagAck, s.sndNxt)
}
1121858
func (m *MultipartReply) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, *m, pad4{})
}
81525
func (q *QueueStatsRequest) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, q.Port, q.Queue)
}
549435
func (conn *UDPConn) Send(p Packet) error {
	_, err := conn.Write(p.Bytes())
	return err
}
257956
func (ec *EthereumClient) SendTransaction(ctx *Context, tx *Transaction) error {
	return ec.client.SendTransaction(ctx.context, tx.tx)
}
1075690
func (c *Client) Send(packet Packet) error {
	addr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", c.ip, c.port))
	if err != nil {
		return err
	}
	conn, err := net.DialUDP("udp", c.laddr, addr)
	if err != nil {
		return err
	}
	defer conn.Close()

	data, err := packet.MarshalBinary()
	if err != nil {
		return err
	}

	if _, err = conn.Write(data); err != nil {
		return err
	}
	return nil
}
743641
func (b *BucketCounter) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, b.PacketCount, b.ByteCount)
}
1190124
func (nc *Conn) sendProto(proto string) {
	nc.mu.Lock()
	nc.bw.WriteString(proto)
	nc.kickFlusher()
	nc.mu.Unlock()
}
861626
func (c *client) sendProto(info []byte, doFlush bool) {
	if c.nc == nil {
		return
	}
	c.queueOutbound(info)
	if !(doFlush && c.flushOutbound()) {
		c.flushSignal()
	}
}
149550
func (c *Conn) WriteTo(b []byte, addr net.Addr) (int, error) {
	return c.p.WriteTo(b, addr)
}
1258826
func (p *packetConn) WriteTo(b []byte, _ net.Addr) (int, error) {
	return syscall.Write(p.fd, b)
}
724092
func (ps *PeerRoundState) MarshalTo(data []byte) (int, error) {
	bs, err := ps.Marshal()
	if err != nil {
		return -1, err
	}
	return copy(data, bs), nil
}
1353767
func (c *Client) SendRequest(offerPacket *dhcp4.Packet) (dhcp4.Packet, error) {
	requestPacket := c.RequestPacket(offerPacket)
	requestPacket.PadToMinSize()

	return requestPacket, c.SendPacket(requestPacket)
}