Swoole Instant messaging Perplexity

1. Suppose you use swoole to make a web version of Wechat, and the client uses websocket to connect to the server
2. How to realize the private chat of friends (1 to 1), without writing the dead server port
3. Not writing the port means that the server has multiple ports to provide services; if A wants to chat with B 1-to-1, then A may connect to port an and B to port B. when A sends a message to B, how does the server know which tcp connection B is under?

Jun.25,2021

write a function that maps userID to port
such as the simplest

  

make a userid to client mapping in the cloud or memory. The sending packet carries the userid, to be sent and pushed to the client of the response according to the mapping

.
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-1e545e7-452bb.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-1e545e7-452bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?