![]() ![]() | Notify your coworkers any message anywhere
Contents: 1. Introduction Polling -- Basically there are two ways, polling and notification, to enable a team of coworkers to share a center data store. The first way is that each of coworkers sends the remote data store a request to get the latest version of required data periodically at a predefined time interval. This method is called as polling, but it has two basic flaws: (1) that it consumes a large portion of network bandwidth, and (2) that other workers can never get the latest version of data in real-time fashion. Therefore, you can not use polling if you want to support a large number of clients. Overall, polling is not a good choice for real professional software. Chat service or real-time notification -- The second way is that a coworker sends a message to one or more coworkers right after he or she has just made a change to the shared data store. Afterwards, coworkers pick up the message, analyze it and send a request to the data store for the latest version of just wanted data. The second way is slightly more complicate than the first one, but it is much more elegant and eliminates the two basic flaws of the first way. It can supports much more clients than polling with much better scalability. If your project requires exchanging data between clients and server, you may need to consider re-designing your system with use of real-time notification for better performance and supporting more clients. Built-in bi-directional asynchronous chat service -- SocketPro has a powerful built-in service named as chat service with the second way for you to notify one or more coworkers in real time fashion, when there is an interesting event to a shared data store on both client and server sides. Because SocketPro fully supports Pocket PC and smart phone with the same set of APIs, you can also use SocketPro to notify a team of coworkers from these devices easily. Further, all of socket connections inherit this service automatically, right after a client calls the method IUSocket::SwitchTo. 2.
Available sample projects 3.
Real-time notification in SocketPro
With help of SocketPro, you can share chat service with another service like OLEDB database service as shown inside the sample projects DBAatHome and OneBigBatch without requiring a new socket connection because all of other services inherit chat service. Additionally, you can use an independent socket connection to exchange messages with other clients. 4. Set
up your real-time notification on server side for broadcasting messages
Note
that SocketPro supports any number of chat groups. All of group identification
numbers must be unique except zero.
All of the above server samples show you how to set up chat service. 5. Fast and intelligent order processing Suppose a sale representative gets an order from a customer, the representative will send a message to order processing department after he or she inputs a set of data into a shared database. The code will be something like the following: BeginBatching();
int []groups = {16}; GetAttachedClientSocket().Push.Broadcast("I can't input order data into our database. IT department needs to fix the problem immediately!", groups);
groups[0] = 16;
{ } Once a successful message arrives Order Processing Department, one employee may use the following code to process the message. BeginBatching();
int []groups = {16};
int[] groups = {4, 8,16};
int []groups = {16,4}; } The above notifications will significantly speed up the processing. If there is any thing wrong, other coworkers will be notified immediately. This is just one sample only. It is not difficult at all to find many many more samples like this one. For how to track these notification on client side, please see the above samples. It is a really simple step. 6. Send your coworkers messages on both client and server sides As shown in tutorial two and in the section 4, SocketPro supports bi-directional real time notification on both client and server sides. Server side notification is faster than client side notification. You can embed real-time notification to server code so that your service is more powerful and smarter.
Real-time pushing data
from SocketPro server onto browsers using SocketPro plug-in |