func sendTestData(conn gop2p.Conn) { ticker := time.Tick(3 * time.Second) for _ = range ticker { conn.SendData([]byte("Test")) } }
func (handler *TestHandler) ReceivedData(conn gop2p.Conn, pack *gop2p.Package) { log.Printf("ReceivedData: %+v\r\n", *pack) if !pack.IsResponse { conn.ResponseSuccess(pack) } }