Allenxuxu / gev

🚀Gev is a lightweight, fast non-blocking TCP network library / websocket server based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
MIT License
1.73k stars 194 forks source link

Websocket如何實踐廣播跟多播? #21

Closed thaiwu0107 closed 5 years ago

thaiwu0107 commented 5 years ago

Websocket 要怎麼廣播跟多播給客戶端呢? 要自己存一個 map 來使用嗎?

或是底層已經有一個 map 可以開放出來避免重複儲存?

Allenxuxu commented 5 years ago

建议是自己存一个 map 来使用, 如果开放底层的map会必然导致一些竞争问题,比起节约的这一点内存,实在得不偿失。