| janus_app | | (one_for_one) +-------------------+------------------+--------------------+ | | | | | | | | topman janus_acceptor (supervisor) mapper | | | | (simple_one_for_one) +--------+-------| +--------+-------+ | | | | | | | | | | | | pubsub ... pubsub ... transport ... (topic:<<"T1">>) (topic:<<"T2">>) | | (janus_flash 封装层) | client_proxy其中
flashbot janus <regular-socket/>,0,PING,0 ----------------------------------------------> { "timestamp":[1448,434925,303633], "token":[55,97,55,100,48,102,56,98,102,97,97,49,54,101,48,48,48,100,101,99,54,55,48,57,55,99,101,99,97,99,56,56] },1 <---------------------------------------------- <regular-socket/>,0, { "action":"subscribe", "data":"events" },0 ----------------------------------------------> ACK,1 <---------------------------------------------- { "timestamp":[1448,434925,395864], "topic":"events", "event":"test_event", "message_id":"", "data":"test" },1 <---------------------------------------------- <regular-socket/>,0, { "action":"unsubscribe", "data":"events" },0 ---------------------------------------------->对应
00000000 3c 72 65 67 75 6c 61 72 2d 73 6f 63 6b 65 74 2f <regular -socket/ 00000010 3e 00 50 49 4e 47 00 >.PING. 00000000 7b 22 74 69 6d 65 73 74 61 6d 70 22 3a 5b 31 34 {"timest amp":[14 00000010 34 38 2c 34 33 34 39 32 35 2c 33 30 33 36 33 33 48,43492 5,303633 00000020 5d 2c 22 74 6f 6b 65 6e 22 3a 5b 35 35 2c 39 37 ],"token ":[55,97 00000030 2c 35 35 2c 31 30 30 2c 34 38 2c 31 30 32 2c 35 ,55,100, 48,102,5 00000040 36 2c 39 38 2c 31 30 32 2c 39 37 2c 39 37 2c 34 6,98,102 ,97,97,4 00000050 39 2c 35 34 2c 31 30 31 2c 34 38 2c 34 38 2c 34 9,54,101 ,48,48,4 00000060 38 2c 31 30 30 2c 31 30 31 2c 39 39 2c 35 34 2c 8,100,10 1,99,54, 00000070 35 35 2c 34 38 2c 35 37 2c 35 35 2c 39 39 2c 31 55,48,57 ,55,99,1 00000080 30 31 2c 39 39 2c 39 37 2c 39 39 2c 35 36 2c 35 01,99,97 ,99,56,5 00000090 36 5d 7d 01 6]}. 00000017 3c 72 65 67 75 6c 61 72 2d 73 6f 63 6b 65 74 2f <regular -socket/ 00000027 3e 00 7b 22 61 63 74 69 6f 6e 22 3a 22 73 75 62 >.{"acti on":"sub 00000037 73 63 72 69 62 65 22 2c 22 64 61 74 61 22 3a 22 scribe", "data":" 00000047 65 76 65 6e 74 73 22 7d 00 events"} . 00000094 41 43 4b 01 ACK. 00000098 7b 22 74 69 6d 65 73 74 61 6d 70 22 3a 5b 31 34 {"timest amp":[14 000000A8 34 38 2c 34 33 34 39 32 35 2c 33 39 35 38 36 34 48,43492 5,395864 000000B8 5d 2c 22 74 6f 70 69 63 22 3a 22 65 76 65 6e 74 ],"topic ":"event 000000C8 73 22 2c 22 65 76 65 6e 74 22 3a 22 74 65 73 74 s","even t":"test 000000D8 5f 65 76 65 6e 74 22 2c 22 6d 65 73 73 61 67 65 _event", "message 000000E8 5f 69 64 22 3a 22 22 2c 22 64 61 74 61 22 3a 22 _id":"", "data":" 000000F8 74 65 73 74 22 7d 01 test"}. 00000050 3c 72 65 67 75 6c 61 72 2d 73 6f 63 6b 65 74 2f <regular -socket/ 00000060 3e 00 7b 22 61 63 74 69 6f 6e 22 3a 22 75 6e 73 >.{"acti on":"uns 00000070 75 62 73 63 72 69 62 65 22 2c 22 64 61 74 61 22 ubscribe ","data" 00000080 3a 22 65 76 65 6e 74 73 22 7d 00 :"events "}.
flashbot janus <regular-socket/>,0,PUBLISH,0 { "topic":"events", "event":"test_event", "message_id":"", "data":"test" } ----------------------------------------------> { "timestamp":[1448,434925,395595], "token":[100,52,97,53,56,51,54,99,57,97,50,52,50,57,52,57,55,48,52,102,48,100,99,53,102,55,56,101,101,97,53,98] },1 <----------------------------------------------对应
00000000 3c 72 65 67 75 6c 61 72 2d 73 6f 63 6b 65 74 2f <regular -socket/ 00000010 3e 00 50 55 42 4c 49 53 48 00 7b 22 74 6f 70 69 >.PUBLIS H.{"topi 00000020 63 22 3a 22 65 76 65 6e 74 73 22 2c 22 65 76 65 c":"even ts","eve 00000030 6e 74 22 3a 22 74 65 73 74 5f 65 76 65 6e 74 22 nt":"tes t_event" 00000040 2c 22 6d 65 73 73 61 67 65 5f 69 64 22 3a 22 22 ,"messag e_id":"" 00000050 2c 22 64 61 74 61 22 3a 22 74 65 73 74 22 7d ,"data": "test"} 00000000 7b 22 74 69 6d 65 73 74 61 6d 70 22 3a 5b 31 34 {"timest amp":[14 00000010 34 38 2c 34 33 34 39 32 35 2c 33 39 35 35 39 35 48,43492 5,395595 00000020 5d 2c 22 74 6f 6b 65 6e 22 3a 5b 31 30 30 2c 35 ],"token ":[100,5 00000030 32 2c 39 37 2c 35 33 2c 35 36 2c 35 31 2c 35 34 2,97,53, 56,51,54 00000040 2c 39 39 2c 35 37 2c 39 37 2c 35 30 2c 35 32 2c ,99,57,9 7,50,52, 00000050 35 30 2c 35 37 2c 35 32 2c 35 37 2c 35 35 2c 34 50,57,52 ,57,55,4 00000060 38 2c 35 32 2c 31 30 32 2c 34 38 2c 31 30 30 2c 8,52,102 ,48,100, 00000070 39 39 2c 35 33 2c 31 30 32 2c 35 35 2c 35 36 2c 99,53,10 2,55,56, 00000080 31 30 31 2c 31 30 31 2c 39 37 2c 35 33 2c 39 38 101,101, 97,53,98 00000090 5d 7d 01 ]}.