How does workerman specify that users send messages?

how can workerman, like gatewayworker, bind uid and client_id together to send messages to designated users, online, etc., and beg for help from bosses, so that good people can live a safe life!

Jun.25,2021

http://doc.workerman.net/faq/.
, is this what you need?


gatewayworker framework native support, wokerman itself does not support, this needs to be implemented by yourself, the general principle is:

  1. create a mapping table: specifically used to store the mapping between uid and client_id.
  2. about the mapping relationship between uid and client_id: you can either one-to-many or force one-to-one.
  3. the mapping relationship is written every time you log in, and the corresponding mapping record is deleted according to client_id each time you exit.
  4. encapsulates an interface similar to Gateway::sendToUid ($uid, $message): look up $client_id based on $uid
  5. finally call Gateway::sendToClient ($client_id, $message) to send.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5ba7-317bd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5ba7-317bd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?