The purpose of this sample is to introduce developers to delegates and events. Delegates and events are a type-safe method callback mechanism. The sample declares a “chat” server type that multiple “clients” can connect to. Each client registers a delegate (callback method) with the server. Then, when one client sends a string message to the server, the server forwards the message to all registered clients. This code has two implementations. The first uses delegates showing low-level callback mechanism. The second implementation uses events showing how events hide most of the low-level goo associated with delegates.
This sample list located in the Chat directory of the NGWS SDK sample directories.
For Example:
C:\Program Files\NGWSSDK\Samples\Chat
In order to properly build and run this sample, the following steps need to be performed prior to building and running the sample…
For Example:
C:\Program Files\NGWSSDK\Samples\Chat\:>NMAKE All
In order to run this sample, follow the instructions listed below.
For Example:
C:\Program Files\NGWSSDK\Samples\Chat\:>Chat