上传战斗测试程序
This commit is contained in:
parent
0490d643aa
commit
84a846e553
@ -112,6 +112,7 @@ func Test_Comment(t *testing.T) {
|
||||
fmt.Println(err)
|
||||
break locp
|
||||
}
|
||||
fmt.Printf("收到消息: %d\n", time.Now().UnixMilli())
|
||||
if err = proto.Unmarshal(data, msg); err != nil {
|
||||
fmt.Println(err)
|
||||
break locp
|
||||
@ -119,14 +120,18 @@ func Test_Comment(t *testing.T) {
|
||||
fmt.Println(msg)
|
||||
}
|
||||
}()
|
||||
|
||||
msg := &pb.BattleRpcMessage{
|
||||
Rid: 1,
|
||||
Method: "Check",
|
||||
for i := 0; i < 3; i++ {
|
||||
msg := &pb.BattleRpcMessage{
|
||||
Rid: 1,
|
||||
Method: "Check",
|
||||
}
|
||||
msg.Data, _ = anypb.New(&pb.BattleReport{})
|
||||
data, _ := proto.Marshal(msg)
|
||||
fmt.Printf("发送消息: %d\n", time.Now().UnixMilli())
|
||||
connect.WriteMessage(websocket.BinaryMessage, data)
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
msg.Data, _ = anypb.New(&pb.BattleReport{})
|
||||
data, _ := proto.Marshal(msg)
|
||||
connect.WriteMessage(websocket.BinaryMessage, data)
|
||||
|
||||
//监听外部关闭服务信号
|
||||
c := make(chan os.Signal, 1)
|
||||
//添加进程结束信号
|
||||
|
Loading…
Reference in New Issue
Block a user