func SendUint32(to io.Writer, typ Type, val uint32) error {
	var buf [4]byte
	binary.BigEndian.PutUint32(buf[:], val)
	return SendTLV(to, typ, buf[:])
}
SendUint32 sends a given type with a uint32 value to the given writer.
package protocol
import (
	"encoding/binary"
	"fmt"
	"io"
)
type Type uint16
const (
	TypeBlockIndex Type = 0
	TypeServerToClient Type = 0x8000 + iota
	TypeWaitingForFanoutIndex
	TypeFanoutSize
	TypeBlockSize
	TypeNumBlocks
	TypeClientToServer Type = 0xC000 + iota
	TypeFanoutIndex
	TypeError Type = 0xFFFF
)
var TypeNames = map[Type]string{
	TypeBlockIndex:            "BlockIndex",
	TypeServerToClient:        "ServerToClient",
	TypeWaitingForFanoutIndex: "WaitingForFanoutIndex",
	TypeFanoutSize:            "FanoutSize",
	TypeBlockSize:             "BlockSize",
	TypeNumBlocks:             "NumBlocks",
	TypeClientToServer:        "ClientToServer",
	TypeFanoutIndex:           "FanoutIndex",
	TypeError:                 "Error",
}
func TypeOf(t Type) Type {
	switch {
	case t&0x8000 == 0:
		return TypeBlockIndex
	case t > TypeServerToClient && t < TypeClientToServer:
		return TypeServerToClient
	case t > TypeClientToServer && t < TypeError:
		return TypeClientToServer
	}
	return TypeError
}
func SendType(to io.Writer, typ Type) error {
	return SendTLV(to, typ, nil)
}