func SendWire(conn net.Conn, w []byte) (err error) {
	var nw int
	if _, ok := conn.(*net.TCPConn); ok {
		n := len(w)
		b := []byte{byte(n >> 8), byte(n)}
		if nw, err = conn.Write(b); err != nil {
			return
		}

		if nw != len(b) {
			return fmt.Errorf("Message.Send: write %d != %d", nw, len(b))
		}
	}

	if nw, err = conn.Write(w); err != nil {
		return
	}

	if nw != len(w) {
		err = fmt.Errorf("Message.Send: write %d != %d", nw, len(w))
	}
	return
}
// SendWire sends w through conn and returns an Error of any.  If the conn is a
// *net.TCPConn then the 2 byte msg len is prepended.
SendWire sends w through conn and returns an Error of any.  If the conn is a
*net.TCPConn then the 2 byte msg len is prepended.
// SendWire sends w through conn and returns an Error of any . If the conn is a // * net . TCPConn then the 2 byte msg len is prepended .
func SendWire(conn net.Conn, w []byte) (err error) {
	var nw int
	if _, ok := conn.(*net.TCPConn); ok {
		n := len(w)
		b := []byte{byte(n >> 8), byte(n)}
		if nw, err = conn.Write(b); err != nil {
			return
		}
		if nw != len(b) {
			return fmt.Errorf("Message.Send: write %d != %d", nw, len(b))
		}
	}
	if nw, err = conn.Write(w); err != nil {
		return
	}
	if nw != len(w) {
		err = fmt.Errorf("Message.Send: write %d != %d", nw, len(w))
	}
	return
}
func SendWire ( conn net . Conn , w [ ] byte ) ( err error ) { var nw int if _ , ok := conn . ( * net . TCPConn ) ; ok { n := len ( w ) b := [ ] byte { byte ( n >> 8 ) , byte ( n ) } if nw , err = conn . Write ( b ) ; err != nil { return } if nw != len ( b ) { return fmt . Errorf ( " " , nw , len ( b ) ) } } if nw , err = conn . Write ( w ) ; err != nil { return } if nw != len ( w ) { err = fmt . Errorf ( " " , nw , len ( w ) ) } return }
SendWire sends w through conn and returns an Error of any.
SendWire sends w through conn and returns an Error of any .