Beispiel #1
0
func writeToFile(p *osc.OscPacket) {
	file, err := os.Create("message1.bin")

	if err != nil {
		panic(err)
	}
	defer file.Close()
	data := p.SerializeTCP()
	file.Write(data)
}
Beispiel #2
0
func sendAsUDP(p *osc.OscPacket) {
	addr, _ := net.ResolveUDPAddr("udp", "localhost:10001")
	conn, err := net.DialUDP("udp", nil, addr)

	if err != nil {
		panic(err)
	}
	defer conn.Close()
	data := p.SerializeUDP()
	_, err = conn.Write(data)

	if err != nil {
		panic(err)
	}
}