regmicmahesh / duckchatstallmaninspired

GNU General Public License v3.0
13 stars 2 forks source link

Refactor server #2

Open regmicmahesh opened 2 years ago

regmicmahesh commented 2 years ago

Refactor server to have a struct named server which holds a conn and number of online users in it, also maintain the number of online users by sending ping to users. the format for ping can be as follows

1:1 Here, 1 denotes server. and another 1 denotes ping message.

this should be discarded by client.

regmicmahesh commented 2 years ago

also client should not reply to this ping message as the sole purpose of ping is to identify if tcp socket is alive or not.

regmicmahesh commented 2 years ago

Mostly done remaining task is to show list of online users.

regmicmahesh commented 2 years ago

I'm looking for channels alternatives in servers to handle broadcasts.