From a5eb81b5e06008773c01551541dc1ce9b083b4d7 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Thu, 17 Feb 2022 21:33:23 +0800 Subject: [PATCH] Refactoring code --- main/main.go | 13 +++++++++---- ws_wrapper/ws_local_server/ws_handle.go | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/main/main.go b/main/main.go index 171f44951..fae5a1d8e 100644 --- a/main/main.go +++ b/main/main.go @@ -23,7 +23,7 @@ func main() { strMyUidx := "18666662412" //friendUserID := "openIM2222" - tokenx := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVSUQiOiIxODY2NjY2MjQxMiIsIlBsYXRmb3JtIjoiSU9TIiwiZXhwIjoxNjQ1NjE2NzI2LCJuYmYiOjE2NDUwMTE5MjYsImlhdCI6MTY0NTAxMTkyNn0.AR9khKiUXNDUu1gxNY7cqeZmmDyIMXFd6hlnJsppt0o" + tokenx := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVSUQiOiIxODY2NjY2MjQxMiIsIlBsYXRmb3JtIjoiSU9TIiwiZXhwIjoxNjQ1Njg5NjU3LCJuYmYiOjE2NDUwODQ4NTcsImlhdCI6MTY0NTA4NDg1N30.nV3cIcvaRjyUEay8G7UMe5LzKeNi6UenET1RXDT4Nao" test.InOutDoTest(strMyUidx, tokenx, WSADDR, APIADDR) //test.DoTestCreateGroup() //test.SetTestFriendID(friendUserID) @@ -68,10 +68,15 @@ func main() { // open_im_sdk.DoTestDeleteFromBlackList() //DoTestGetDesignatedFriendsInfo() //test.DoTestSendMsg(strMyUidx, test.Friend_uid) - test.DoTestSendImageMsg("", test.Friend_uid) + // test.DoTestSendImageMsg("", test.Friend_uid) + i := 0 for true { - time.Sleep(time.Duration(100) * time.Second) - // test.DoTestSendMsg(strMyUidx, test.Friend_uid) + + time.Sleep(time.Duration(1) * time.Second) + + test.DoTestSendMsg(strMyUidx, test.Friend_uid) + i++ + fmt.Println("DoTestSendMsg count: ", i) fmt.Println("waiting") } // diff --git a/ws_wrapper/ws_local_server/ws_handle.go b/ws_wrapper/ws_local_server/ws_handle.go index 63705ea6e..f2075131f 100644 --- a/ws_wrapper/ws_local_server/ws_handle.go +++ b/ws_wrapper/ws_local_server/ws_handle.go @@ -119,6 +119,9 @@ func GenUserRouterNoLock(uid string) *RefRouter { wsRouter1.SetFriendListener() wrapSdkLog("SetGroupListener() ", uid) wsRouter1.SetGroupListener() + wrapSdkLog("SetUserListener() ", uid) + wsRouter1.SetUserListener() + var rr RefRouter rr.refName = &RouteMap1 rr.wsRouter = &wsRouter1