Database Reference
In-Depth Information
• Registering new users
• Updating the list of friends
• Logging in
• Each message has a sender, receiver, message body, and timestamps
for sending and reading the message.
• For messages, there are methods for:
• Sending a message
• Retrieving new messages
A minimalistic system implementing this could look like the following:
Here, a web page opens a WebSocket ( ws:// ) to a HUB (a message concentrator)
which in turn talks to a database. On each new connection, the HUB logs in and on
successful login opens a WebSocket connection to the web page. It then sends all
new messages that have accumulated for the logged-in user since the last time they
retrieved their messages. After that, the HUB waits for new messages and pushes
them to the web page as they arrive.
The database part has two tables, the user_info table:
CREATE TABLE user_info (
username text primary key,
pwdhash text not null, -- base64 encoded
md5 hash of password
Search WWH ::




Custom Search