gatewayworker如getClientIdByUid对同一个用户时常出现一会获取到client_id,一会又获取不到

louissun

gatewayworker如getClientIdByUid对同一个用户时常出现一会获取到client_id,一会又获取不到,过一会之后又能获取到,期间浏览器一直在每隔20秒发送数据ping数据,不太可能在存在掉线的问题,
getClientIdByUid等等方法也存在该问题

1856 2 0
2个回答

walkor

自己记录下日志,bindUid的时候记录uid和client_id,onClose的时候记录client_id。当getClientIdByUid获取不到的时候功过getAllClientIdList 获取下所有在线client_id看看bindUid的时候记录的client_id是否存在。如果存在,说明没有执行到bindUid,或者getClientIdByUid时传的uid不对。如果不存在,说明连接已经关闭,在onclose日志找是否有client_id相关日志。

  • louissun 2019-10-28

    @walkor这是发送信息的全部打印后的信息,中间没有截取掉任何一部分
    //recv_id为接受短信息的uid,send_id为发送短信息的uid
    //第一次为17发送给4
    recv_id:["7f00000108ff00000005"] //能够获取到接受者的client_id
    send_id:[] //能够获取到发送者的client_id
    all_client:{"7f00000108fe00000004":"7f00000108fe00000004","7f00000108fc00004fb1":"7f00000108fc00004fb1","7f00000108fc00004fb3":"7f00000108fc00004fb3","7f00000108fc00004fb4":"7f00000108fc00004fb4","7f00000108fc00004fb5":"7f00000108fc00004fb5","7f00000108fc00004fb6":"7f00000108fc00004fb6","7f00000108fc00004fb7":"7f00000108fc00004fb7","7f00000108fc00004fbb":"7f00000108fc00004fbb","7f00000108fc00004fc0":"7f00000108fc00004fc0","7f00000108fc00004fc1":"7f00000108fc00004fc1","7f00000108fc00004fc2":"7f00000108fc00004fc2","7f00000108fc00004fc3":"7f00000108fc00004fc3","7f00000108fc00004fc4":"7f00000108fc00004fc4","7f00000108fc00004fc5":"7f00000108fc00004fc5","7f00000108fc00004fc8":"7f00000108fc00004fc8","7f00000108fc00004fcc":"7f00000108fc00004fcc","7f00000108fc00004fcd":"7f00000108fc00004fcd","7f00000108fc00004fd0":"7f00000108fc00004fd0","7f00000108fc00004fd4":"7f00000108fc00004fd4","7f00000108fc00004fd5":"7f00000108fc00004fd5","7f00000108fc00004fd6":"7f00000108fc00004fd6","7f00000108fc00004fd7":"7f00000108fc00004fd7","7f00000108fc00004fda":"7f00000108fc00004fda","7f00000108fc00004fdb":"7f00000108fc00004fdb","7f00000108fc00004fdc":"7f00000108fc00004fdc","7f00000108fc00004fdd":"7f00000108fc00004fdd","7f00000108fc00004fe1":"7f00000108fc00004fe1","7f00000108fc00004fe2":"7f00000108fc00004fe2","7f00000108fc00004fe3":"7f00000108fc00004fe3","7f00000108fc00004fe5":"7f00000108fc00004fe5","7f00000108fc00004ff1":"7f00000108fc00004ff1","7f00000108fc00004ff3":"7f00000108fc00004ff3","7f00000108fc00004ff5":"7f00000108fc00004ff5","7f00000108fc00004ff6":"7f00000108fc00004ff6","7f00000108fc00004ffe":"7f00000108fc00004ffe","7f00000108fc00005002":"7f00000108fc00005002","7f00000108fc00005004":"7f00000108fc00005004","7f00000108fc00005006":"7f00000108fc00005006","7f00000108fc00005007":"7f00000108fc00005007","7f00000108fc00005025":"7f00000108fc00005025","7f00000108fc000050d0":"7f00000108fc000050d0","7f00000108fc000050d1":"7f00000108fc000050d1","7f00000108fc000050d2":"7f00000108fc000050d2","7f00000108fc000050d3":"7f00000108fc000050d3","7f00000108fc000050d4":"7f00000108fc000050d4","7f00000108fc000050d6":"7f00000108fc000050d6","7f00000108fc000050d7":"7f00000108fc000050d7","7f00000108fc000050d8":"7f00000108fc000050d8","7f00000108fc000050db":"7f00000108fc000050db","7f00000108fc000050dd":"7f00000108fc000050dd","7f00000108fc000050de":"7f00000108fc000050de","7f00000108fc000050e0":"7f00000108fc000050e0","7f00000108fc000050e3":"7f00000108fc000050e3","7f00000108fc000050eb":"7f00000108fc000050eb","7f00000108fc000050ec":"7f00000108fc000050ec","7f00000108fc000050ee":"7f00000108fc000050ee","7f00000108fc000050f3":"7f00000108fc000050f3","7f00000108fc000050f4":"7f00000108fc000050f4","7f00000108fc000050f7":"7f00000108fc000050f7","7f00000108fc000050f9":"7f00000108fc000050f9","7f00000108fc00005100":"7f00000108fc00005100","7f00000108fc00005101":"7f00000108fc00005101","7f00000108fc00005106":"7f00000108fc00005106","7f00000108fc00005107":"7f00000108fc00005107","7f00000108fc0000510b":"7f00000108fc0000510b","7f00000108fc00005114":"7f00000108fc00005114","7f00000108fc00005115":"7f00000108fc00005115","7f00000108fc00005117":"7f00000108fc00005117","7f00000108fc0000511a":"7f00000108fc0000511a","7f00000108fc0000511c":"7f00000108fc0000511c","7f00000108fc0000511d":"7f00000108fc0000511d","7f00000108fc0000511e":"7f00000108fc0000511e","7f00000108fc0000511f":"7f00000108fc0000511f","7f00000108fc00005120":"7f00000108fc00005120","7f00000108fc00005121":"7f00000108fc00005121","7f00000108fc00005122":"7f00000108fc00005122","7f00000108fc00005125":"7f00000108fc00005125","7f00000108fc00005128":"7f00000108fc00005128","7f00000108fc0000516d":"7f00000108fc0000516d","7f00000108fc0000516e":"7f00000108fc0000516e","7f00000108fc0000516f":"7f00000108fc0000516f","7f00000108fc00005171":"7f00000108fc00005171","7f00000108fc00005172":"7f00000108fc00005172","7f00000108fc00005173":"7f00000108fc00005173","7f00000108fc00005175":"7f00000108fc00005175","7f00000108fc00005176":"7f00000108fc00005176","7f00000108fc00005178":"7f00000108fc00005178","7f00000108fc00005179":"7f00000108fc00005179","7f00000108fc0000517a":"7f00000108fc0000517a","7f00000108fc0000517b":"7f00000108fc0000517b","7f00000108fc0000517c":"7f00000108fc0000517c","7f00000108fc0000517d":"7f00000108fc0000517d","7f00000108fc0000517f":"7f00000108fc0000517f","7f00000108fc00005185":"7f00000108fc00005185","7f00000108fc00005186":"7f00000108fc00005186","7f00000108fc00005187":"7f00000108fc00005187","7f00000108fc00005188":"7f00000108fc00005188","7f00000108fc00005189":"7f00000108fc00005189","7f00000108fc0000518a":"7f00000108fc0000518a","7f00000108fc0000518b":"7f00000108fc0000518b","7f00000108fc0000518c":"7f00000108fc0000518c","7f00000108fc0000518d":"7f00000108fc0000518d","7f00000108fc0000518e":"7f00000108fc0000518e","7f00000108fc00005190":"7f00000108fc00005190","7f00000108fc00005191":"7f00000108fc00005191","7f00000108fc00005192":"7f00000108fc00005192","7f00000108fc00005193":"7f00000108fc00005193","7f00000108fc00005194":"7f00000108fc00005194","7f00000108fc00005195":"7f00000108fc00005195","7f00000108fc00005196":"7f00000108fc00005196","7f00000108fc00005197":"7f00000108fc00005197","7f00000108fc00005198":"7f00000108fc00005198","7f00000108fc00005199":"7f00000108fc00005199","7f00000108fc0000519a":"7f00000108fc0000519a","7f00000108fc0000519b":"7f00000108fc0000519b","7f00000108fc0000519c":"7f00000108fc0000519c","7f00000108fc0000519d":"7f00000108fc0000519d","7f00000108fc0000519e":"7f00000108fc0000519e","7f00000108fc0000519f":"7f00000108fc0000519f","7f00000108fc000051a0":"7f00000108fc000051a0","7f00000108fc000052a3":"7f00000108fc000052a3","7f00000108fc000052a5":"7f00000108fc000052a5","7f00000108fc000052a6":"7f00000108fc000052a6","7f00000108fc000052a9":"7f00000108fc000052a9","7f00000108fc000052ad":"7f00000108fc000052ad","7f00000108fc000052b1":"7f00000108fc000052b1","7f00000108fc000052b2":"7f00000108fc000052b2","7f00000108fc000052b3":"7f00000108fc000052b3","7f00000108fc000052b5":"7f00000108fc000052b5","7f00000108fc000052b6":"7f00000108fc000052b6","7f00000108fc000052b7":"7f00000108fc000052b7","7f00000108fc000052b8":"7f00000108fc000052b8","7f00000108fc000052b9":"7f00000108fc000052b9","7f00000108fc000052ba":"7f00000108fc000052ba","7f00000108ff00000004":"7f00000108ff00000004","7f00000108ff00000005":"7f00000108ff00000005"}
    //第二次为4发送给17
    recv_id:["7f00000108fd000053db"] //能够获取到接受者的client_id
    send_id:[] //能够获取到接受者的client_id
    all_client:{"7f00000108fe00000004":"7f00000108fe00000004","7f00000108fc00000005":"7f00000108fc00000005","7f00000108fc00000006":"7f00000108fc00000006","7f00000108fd00005083":"7f00000108fd00005083","7f00000108fd00005084":"7f00000108fd00005084","7f00000108fd00005087":"7f00000108fd00005087","7f00000108fd00005088":"7f00000108fd00005088","7f00000108fd00005089":"7f00000108fd00005089","7f00000108fd0000508b":"7f00000108fd0000508b","7f00000108fd0000508c":"7f00000108fd0000508c","7f00000108fd0000508e":"7f00000108fd0000508e","7f00000108fd0000508f":"7f00000108fd0000508f","7f00000108fd00005090":"7f00000108fd00005090","7f00000108fd00005092":"7f00000108fd00005092","7f00000108fd00005094":"7f00000108fd00005094","7f00000108fd00005095":"7f00000108fd00005095","7f00000108fd00005096":"7f00000108fd00005096","7f00000108fd00005097":"7f00000108fd00005097","7f00000108fd00005098":"7f00000108fd00005098","7f00000108fd0000509d":"7f00000108fd0000509d","7f00000108fd0000509e":"7f00000108fd0000509e","7f00000108fd000050a0":"7f00000108fd000050a0","7f00000108fd000050a3":"7f00000108fd000050a3","7f00000108fd000050a6":"7f00000108fd000050a6","7f00000108fd000050ab":"7f00000108fd000050ab","7f00000108fd000050b0":"7f00000108fd000050b0","7f00000108fd000050bd":"7f00000108fd000050bd","7f00000108fd000050be":"7f00000108fd000050be","7f00000108fd000050c0":"7f00000108fd000050c0","7f00000108fd000050f1":"7f00000108fd000050f1","7f00000108fd000050f7":"7f00000108fd000050f7","7f00000108fd00005124":"7f00000108fd00005124","7f00000108fd000051b5":"7f00000108fd000051b5","7f00000108fd000051b9":"7f00000108fd000051b9","7f00000108fd000051ba":"7f00000108fd000051ba","7f00000108fd000051bc":"7f00000108fd000051bc","7f00000108fd000051c0":"7f00000108fd000051c0","7f00000108fd000051c1":"7f00000108fd000051c1","7f00000108fd000051c3":"7f00000108fd000051c3","7f00000108fd000051c7":"7f00000108fd000051c7","7f00000108fd000051ca":"7f00000108fd000051ca","7f00000108fd000051cb":"7f00000108fd000051cb","7f00000108fd000051ce":"7f00000108fd000051ce","7f00000108fd000051ee":"7f00000108fd000051ee","7f00000108fd000051f0":"7f00000108fd000051f0","7f00000108fd000051f5":"7f00000108fd000051f5","7f00000108fd000051f9":"7f00000108fd000051f9","7f00000108fd000051fc":"7f00000108fd000051fc","7f00000108fd00005204":"7f00000108fd00005204","7f00000108fd00005206":"7f00000108fd00005206","7f00000108fd00005207":"7f00000108fd00005207","7f00000108fd0000520a":"7f00000108fd0000520a","7f00000108fd00005210":"7f00000108fd00005210","7f00000108fd00005213":"7f00000108fd00005213","7f00000108fd00005215":"7f00000108fd00005215","7f00000108fd00005216":"7f00000108fd00005216","7f00000108fd0000521a":"7f00000108fd0000521a","7f00000108fd0000521b":"7f00000108fd0000521b","7f00000108fd0000521c":"7f00000108fd0000521c","7f00000108fd00005294":"7f00000108fd00005294","7f00000108fd00005295":"7f00000108fd00005295","7f00000108fd00005296":"7f00000108fd00005296","7f00000108fd00005297":"7f00000108fd00005297","7f00000108fd00005298":"7f00000108fd00005298","7f00000108fd00005299":"7f00000108fd00005299","7f00000108fd0000529a":"7f00000108fd0000529a","7f00000108fd0000529b":"7f00000108fd0000529b","7f00000108fd0000529c":"7f00000108fd0000529c","7f00000108fd0000529d":"7f00000108fd0000529d","7f00000108fd0000529e":"7f00000108fd0000529e","7f00000108fd0000529f":"7f00000108fd0000529f","7f00000108fd000052a0":"7f00000108fd000052a0","7f00000108fd000052a1":"7f00000108fd000052a1","7f00000108fd000052a2":"7f00000108fd000052a2","7f00000108fd000052a4":"7f00000108fd000052a4","7f00000108fd000052a5":"7f00000108fd000052a5","7f00000108fd000052a6":"7f00000108fd000052a6","7f00000108fd000052a7":"7f00000108fd000052a7","7f00000108fd00005399":"7f00000108fd00005399","7f00000108fd0000539b":"7f00000108fd0000539b","7f00000108fd0000539c":"7f00000108fd0000539c","7f00000108fd0000539d":"7f00000108fd0000539d","7f00000108fd0000539e":"7f00000108fd0000539e","7f00000108fd000053a0":"7f00000108fd000053a0","7f00000108fd000053a1":"7f00000108fd000053a1","7f00000108fd000053a4":"7f00000108fd000053a4","7f00000108fd000053a5":"7f00000108fd000053a5","7f00000108fd000053a6":"7f00000108fd000053a6","7f00000108fd000053a7":"7f00000108fd000053a7","7f00000108fd000053a8":"7f00000108fd000053a8","7f00000108fd000053a9":"7f00000108fd000053a9","7f00000108fd000053aa":"7f00000108fd000053aa","7f00000108fd000053ab":"7f00000108fd000053ab","7f00000108fd000053ad":"7f00000108fd000053ad","7f00000108fd000053ae":"7f00000108fd000053ae","7f00000108fd000053af":"7f00000108fd000053af","7f00000108fd000053b0":"7f00000108fd000053b0","7f00000108fd000053b2":"7f00000108fd000053b2","7f00000108fd000053b3":"7f00000108fd000053b3","7f00000108fd000053b5":"7f00000108fd000053b5","7f00000108fd000053b6":"7f00000108fd000053b6","7f00000108fd000053d7":"7f00000108fd000053d7","7f00000108fd000053da":"7f00000108fd000053da","7f00000108fd000053db":"7f00000108fd000053db","7f00000108ff00000004":"7f00000108ff00000004","7f00000108ff00000005":"7f00000108ff00000005"}
    //关闭浏览器后打印的信息
    close:4, client_id:["7f00000108ff00000005"]
    close:17, client_id:[]

  • walkor 2019-10-28

    你这个日志我看不懂,不知道打印的什么。bindUid的时候记录uid和client_id也没看到。另外如果有unbindUid的地方都记录日志。

  • louissun 2019-10-29

    @1:多谢回复,解决了

louissun

解决了,registerAddress等等这些的默认端口全部修改为其他的端口后,就正常了,但我不太明白这是为什么,如果是端口被占用,不应该是启动不了程序吗?

  • 暂无评论
年代过于久远,无法发表回答
🔝