LAYIM Reviews _2

A database entity corresponds to online friends

1, a database of all users to read information display.

2, correspondence (by linking the user's Id-one correspondence)

        ///  <Summary> 
        /// when connected clients call
         ///  </ Summary> 
        ///  <Returns> </ Returns> 
        public  the override the Task OnConnectedAsync () 
        { 
            Trace.WriteLine ( " client connection successful " ) ;
             return  Base .OnConnectedAsync (); 
        } // all linked client will be here

To be associated, id for each row must be declared and recorded during the corresponding link id

Each row id easily taken, a one-time reading,

When the connection id - corresponds.

 

Buddy lists and message lists two cases

Already know: Can you get links to all clients (this link will be very large, how many million people links, but very few people do their own accounts),

1, so a user just landed situation:

The user must read the database all your friends, you will link all clients have full lighting of the user's friends.

2, the packet is the same as above

 

3, if the situation news

3,1 in the case of the one sent to our online Signalr transit service by the client, we first store database set up unread, the online push, otherwise canceled

3, the customer on the line first read the list of users but the user is lit, and only the said message, determining whether there are unread messages, the message is read from the database with a push client side.

  And change the status of the message has been read, then the user is online, the message id represents the successful push to show the effect has been read.

 

Guess you like

Origin www.cnblogs.com/fger/p/11593595.html