示例#1
0
文件: client.go 项目: RobWC/enet
func ping_on_connect(host enet.Host, ep string, reason int) {
	if reason == 0 {
		host.Write(ep, 0, []byte("hello enet"))
	}
}
示例#2
0
文件: client.go 项目: RobWC/enet
func ping_on_reliable(host enet.Host, ep string, chid uint8, data []byte) {
	s := string([]byte(data))

	fmt.Println(s)
	host.Disconnect(ep)
}
示例#3
0
文件: server.go 项目: RobWC/enet
func pong(host enet.Host, ep string, chanid uint8, payload []byte) {
	host.Write(ep, chanid, payload)

	fmt.Printf("dat pong %v\n", ep)
}