Skip to content

Commit 3ebdecf

Browse files
committed
add log
1 parent 5595b7b commit 3ebdecf

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

test/main.go

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -316,50 +316,17 @@ func getMyIP() string {
316316
}
317317

318318
var (
319-
APIADDR = "http://47.112.160.66:10000"
320-
WSADDR = "ws://47.112.160.66:17778"
321-
REGISTERADDR = "http://47.112.160.66:10000/auth/user_register"
322-
TOKENADDR = "http://47.112.160.66:10000/auth/user_token"
319+
APIADDR = "http://147.112.160.66:10000"
320+
WSADDR = "ws://147.112.160.66:17778"
321+
REGISTERADDR = "http://147.112.160.66:10000/auth/user_register"
322+
TOKENADDR = "http://147.112.160.66:10000/auth/user_token"
323323
SECRET = "tuoyun"
324324
SENDINTERVAL = 20
325325
)
326326

327-
func int64ToString(i int64) string {
328-
return strconv.FormatInt(i, 10)
329-
}
330-
331-
func getCurrentTimestampByNano() int64 {
332-
return time.Now().UnixNano()
333-
}
334-
335-
func getMsgID(sendID string) string {
336-
t := int64ToString(getCurrentTimestampByNano())
337-
return open_im_sdk.Md5(t + sendID + int64ToString(rand.Int63n(getCurrentTimestampByNano())))
338-
}
339-
340327
// myuid, maxuid, msgnum
341328
func main() {
342-
343-
for {
344-
fmt.Println("id: ", getMsgID("xyz"))
345-
}
346-
347-
/*
348-
myUid1 := 17396220460
349-
strMyUid1 := GenUid(myUid1)
350-
351-
runRigister(strMyUid1)
352-
token1 := runGetToken(strMyUid1)
353-
open_im_sdk.DoTest(strMyUid1, token1, WSADDR, APIADDR)
354-
355-
356-
for true {
357-
time.Sleep(time.Duration(60) * time.Second)
358-
fmt.Println("waiting")
359-
}
360-
*/
361-
362-
//cmdfile := "./cmd.txt"
329+
cmdfile := "./cmd.txt"
363330
uid := flag.Int("uid", 1, "RpcToken default listen port 10800")
364331
uidCount := flag.Int("uid_count", 2, "RpcToken default listen port 10800")
365332
messageCount := flag.Int("message_count", 1, "RpcToken default listen port 10800")
@@ -385,8 +352,7 @@ func main() {
385352
runRigister(strMyUid)
386353
token := runGetToken(strMyUid)
387354

388-
//cmd := GetCmd(myUid, cmdfile)
389-
cmd := 2
355+
cmd := GetCmd(myUid, cmdfile)
390356

391357
fmt.Println("getcmd value ", cmd)
392358
switch cmd {

0 commit comments

Comments
 (0)