General discussion

Locked

Server-side solution for web conference

By DevNiko68 ·
The server-side solution of the web conference example is a C# console application. It uses the background support of Ozeki VoIP SIP SDK by being derived from the Ozeki MediaGateway class. This means that the server overrides some basic methods and defines a few others for the client-client communication and it can run properly.
The code shows the method that runs when the server starts. It is an overridden method from the MediaGateway class and basically just initializes the client list as a Dictionary.
1. public override void OnStart()
2. {
3. chatClients = new Dictionary<string, IClient>();
4. Console.WriteLine("Web2Web Gateway started.");
5. }
In next code you can see the method that is invoked when a client connects to the server. It is also an overridden method that puts the newly connected client in the client list and writes some log information on the console.
1. public override void OnClientConnect(IClient client, object[] parameters)
2. {
3. Console.WriteLine( "{0} client connected to the server.",client.RemoteAddress);
4. if (!chatClients.ContainsKey(string.Format("client{0}", clientCounter++)))
5. {
6. chatClients.Add(string.Format("client{0}", clientCounter++), client);
7. }
8. }
When a client is disconnected from the server, the method shown in the following code is invoked. This method only contains basic debug information as the client list is handled in another one.
1. public override void OnClientDisconnect(IClient client)
2.
3.
4. if (chatClients.ContainsValue(client))
5. {
6. Console.WriteLine("{0} client disconnected from the server.", client.RemoteAddress);
7. return;
8. }
If you need more infor then you can visit this page:

http://voip-sip-sdk.com/p_399-voip-flash-web-conference-voip.html

Bye,
Niko

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Networks Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums