Rtc Client Api Download

-->

Microsoft Corporation

October 2003

Applies to:
Microsoft® Real-Time Communications Client API version 1.2
Live Communications Server
Instant Messaging applications

Summary: The Microsoft Real-Time Communications (RTC) Client application programming interface (API) version 1.2 is very efficient under most circumstances. However, when multiple clients are serviced with the same computer, providing optimal scalability is an important consideration in the application's design. This paper discusses techniques you can incorporate into RTC Client API applications to improve their scalability. (18 printed pages)

Hp chromebook 11 g5 seabios for windows. Apr 25, 2016 - Downloads for IBM Rational Team Concert. IBM Rational Team. Plain Java Client Libraries API documentation, All (6.25 MB). Jun 12, 2017 - Downloads for IBM Rational Team Concert. IBM Rational Team. Plain Java Client Libraries API documentation, All (6.32 MB).

Contents

Introduction
Application Scenarios
RTC Client API Architecture Considerations
Scalability Techniques
Scenarios
Conclusion
Related Links

Introduction

It's critical that organizations planning large deployments of real-time communications applications ensure that those applications can scale to meet the desired goals. The RTC Client API is very efficient for client class applications for which each client runs on its own computer. To build a scalable RTC Client API application that services multiple clients with a single computer, you need to ensure that the application is scalable when you design it.

This paper covers techniques available in the RTC Client API that can improve the scalability of RTC Client applications. It begins by describing the types of applications that you can build by using the RTC Client API and then moves into considerations that you need to take into account when building scalable RTC Client applications. Next, the paper addresses techniques that can be used with the RTC Client API to improve scalability. Finally, the paper details three sample applications in terms of how they implement scalability.

Application Scenarios

There are two classes of applications: client and server. Client class applications have one real-time client per computer, such as the traditional instant messenger (IM) application. Server class applications typically act on behalf of multiple users or communicate with many hundreds of users simultaneously.

Server class applications are often based around intelligent applications that interact with users. These applications are also known as automatic robots or simply bots.

Bot-based applications can be divided into two categories: notification bots that send information to a client and interactive bots that accept and respond to a client. A third type of server class applications, Web-based clients, interacts with users through a Web server.

Notification Bots

Notification bots are real-time applications that send information to multiple clients from a centralized server (see Figure 1). The one-way transmission means that clients cannot communicate directly with the notification bot. Instead, clients must choose which events they wish to receive by using some other technique, such as a Web application.

One example of a notification bot is an application that notifies all of the users of a particular e-mail server that the server is about to go offline. Another useful notification bot would send alerts in cases of severe weather.

Figure 1. A notification bot transmits information to multiple IM clients.

Interactive Bots

Interactive bots are applications that allow multiple clients to communicate with a central server in real-time, as Figure 2 shows. They are different from notification bots in that interactive bots support two-way communications with a client. Using this approach, you can build an application that interacts with users in real-time.

Within this scenario, there are two main sub-scenarios. The first provides a user with information and waits for the user to respond, such as an application that notifies users about changes in stock prices and then gives the user the option to buy or sell. The second waits for the user to request a session with the bot and then responds to requests that the user supplies, such as a calendar application that allows a user to schedule meetings and other events while receiving reminders just prior to the meeting or event.

Figure 2. An interactive bot receives and responds to requests from multiple IM clients.

Web-Based Clients

Web-based clients provide the same basic functionality as the traditional IM client through a Web interface, thus allowing the widest possible audience to use the application, as Figure 3 illustrates. It also has the side effect of eliminating the need for a user to download local software, which reduces user concerns about the download containing a potential virus.

These types of clients are useful to organizations that wish to provide a Web-based front end to their internal IM system. For example, a company might wish to use a Web-based IM client to connect customers with a support group. Doing so maximizes the number of customers that can connect with the support group.

Figure 3. A Web-based client hosts multiple IM clients on a single machine by using a Web server to handle the user interface tasks.

RTC Client API Architecture Considerations

The RTC Client API was originally designed to support single-user workstations. This means that there are some issues that you need to consider when designing server class applications.

Threading Issues

For situations in which a server class application needs to register to the SIP server on behalf of multiple users (for example, a Web-based front end to the RTC Client API), the application should create multiple RTCClient objects scattered across multiple threads.

The number of RTCClient objects that each thread can support depends on the complexity of the application, along with the frequency of the messages to be processed for each client. A good starting point is 10 to 15 RTCClient objects per thread in the application. From that starting point, the value can be adjusted up or down to optimize performance.

For example, an author of a scalable application is interested in IM functionality only and doesn't plan to implement any presence functionality. It may be desirable to have more RTCClient objects per thread than compared to some other scalable application that implements both presence and IM functionality for each logged on user.

As the RTC Client API is apartment threaded, all of the resources needed for that particular RTCClient object should also be created on the same thread. And because the RTC Client API relies heavily on the Microsoft Windows® messages being passed between the RTC Client API and the user program, the user code that receives and processes Windows messages should be in the same thread that creates the RTCClient object.

Blocking Issues

Whenever possible, an RTC Client application should avoid calling any routines that might block the thread. Doing so would prevent the thread from processing work for any other clients on that same thread until the blocking activity has been completed. For example, database requests should be made asynchronously so that the thread isn't blocked while waiting for the database server to complete the request.

Scalability Techniques

There are a number of techniques that can be applied to improve the application performance when interacting with the RTC Client API. For the most part, these techniques optimize functionalities that are not necessary for server class applications.

Disable Media Manager

In general, server class applications send and receive text messages, along with tracking presence information. They generally do not transmit nor do they receive audio or video information. It is therefore possible to save resources by disabling the media manager in the RTCClient object. This saves both memory and threads that the RTC client would normally create in case the application will send or receive media at some future time.

To disable the Media Manager, call the IRTCClient2.InitializeEx method and specify the RTCIF_DISABLE_MEDIA value like this:

Disable UPnP based NAT Discovery

Another technique to save resources when the RTCClient object is initialized is to disable Universal Plug and Play– (UPnP) based network address translation (NAT) discovery. If the RTC client computer is located behind a UPnP enabled NAT, UPnP is used to communicate with the NAT device to determine the appropriate IP address and port number that should be used for the real-time session. If the application doesn't communicate to the Internet though a NAT, disabling this feature will save additional resources.

To disable UPnP-based NAT discovery, call the ITRCClient2.InitializeEx method and specify RTCIF_DISABLE_UPNP.

Note that InitializeEx can be called only once, so all of the initialization flags must be combined. For example, this code fragment combines the RTCIF_DISABLE_UPNP flag with the RTCIF_DISABLE_MEDIA flag to disable both UPnP and the Media Manager.

Turn Off Detection and Recovery for IP Address Changes

Another way to improve a server class application's scalability is to disable detection and recovery for IP address changes. RTC Client API has the ability to detect IP address changes for the local host computer where it is running. In a client class application, this ability can be very useful because there are several different circumstances that will force a client to change an IP address. These reasons can range from a dropped dial-up connection to a DHCP initiated address change, so the RTC Client API opens sockets for address change notifications to detect these conditions.

None of these reasons, however, apply to the host of a server class application. Most host computers used as servers are assigned a static IP address that is not likely to change over time.

As it is not likely that the host's IP address will change, additional resources can be saved by turning off IP address changes. Disabling detection and recovery for IP address changes is accomplished by using the RTCIF_ENABLE_SERVER_CLASS flag when initializing the RTCClient object.

Disable Serializing

The RTCIF_ENABLE_SERVER_CLASS flag also disables serialization of SUBSCRIBE requests and getPresence SERVICE requests. This can significantly reduce the number of cycles needed to process these requests.

To avoid sending the server too many presence information SIP requests, the RTC Client API serializes the SIP requests meant for fetching presence information. Scalable applications creating hundreds of presence-related requests should turn off this behavior in order to obtain better throughput in these requests.

The RTCIF_ENABLE_SERVER_CLASS flag also disables serialization.

Care should be taken that the SIP server or any other entity to which these requests are sent is able to handle so many requests simultaneously.

Disabling Firewall Detection

The RTC Client API can detect and traverse through the Internet Connection Firewall (ICF). This functionality is useful for client-side consumer applications, as it minimizes the amount of work it takes to run an RTC Client application with ICF. However, it might not be desirable for server class applications because of the extra resources it takes.

This function is disabled when the RTCIF_ENABLE_SERVER_CLASS flag is passed to the InitializeEx method. This can save some valuable resources on the system, which leads to better scalability.

Avoid Unnecessary Events

One way to avoid extra work by the application is to carefully choose which events should be processed. Events associated with disabled features should always be turned off to reduce the amount of work performed by the RTC Client API. Thus, if the media manager is disabled within the RTC Client API, then all of the events related to processing video and audio streams should also be disabled.

Consider an application that responds only to messages received. There is no need to trap IRTCBuddyEvent or IRTCWatcherEvent —only the RTCEF_MESSAGING event is required. The following code shows how to filter out all of the events except for the RTCEF_MESSAGING event.

Avoid Sending Typing Messages Notifications

While it may be obvious, there isn't a need for any server class application to send typing messages notifications. Typing messages primarily exist for one client to let other clients in a session know that they are actively typing text within the instant messaging session. As server class applications are always online, there is no need for a server class application to expose the typing feature.

If the server class application works with a custom client application, then it's highly desirable that the client application not send typing messages either. Even though the server application ignores the messages, there's a certain amount of overhead that can't be avoided. Also, the typing messages increase bandwidth usage, so typing messages should be avoided in order to improve the scalability of the server application.

Adding Server Class Application as Always Online Contact

Another obvious issue is that a server class application is always online, so there's no need to determine the presence status of the server class application. Forcing the client class application to always add the server class application as an 'always online' contact reduces the amount of work the RTC client must do to process these requests.

Although this technique doesn't directly apply to the server class application, it can be incorporated into a custom client class application interaction with the server application as follows:

Techniques to Improve Scalability in Web-based UI Scenario

Depending on the transport protocol, the RTC Client API uses one or more sockets for each RTC client. When using TCP as a transport, the RTC Client API utilizes three sockets for each registered client. The first socket is the client's listening port, and the second socket is for the new dynamic port that the client creates to connect to the registrar to log on. The third socket is created when the client accepts the connection request on its listening port from the registrar for all notifications. In contrast to TCP, the RTC client uses only one socket when the client is logged on using Transport Level Security (TLS), as there is no listening port in TLS mode.

If an application is running out of available ports for use, the number of available ports can be increased by creating the following registry key and registry values:

The RTC Client API creates an event window for each socket that it uses, so the number of handles required to support a large number of clients can get rather large. As Windows limits the number of handles available to a single process, it might be necessary to implement one of more of the following techniques to improve scalability.

  1. When the RTC client uses TLS for transport, the number of handles required is only one-third that of those required when using TCP as a transport.
  2. When you split the RTC clients over multiple processes, the number of handles is reduced for each process.
  3. It is possible to increase the number of handles available for each process by changing these two registry keys.

Scenarios

This section illustrates how you might implement each of the three server class application scenarios. Note that in all three scenarios, it is assumed that the appropriate RTC Client API objects have been properly initialized and that any necessary sessions have been established.

Scenario 1: Notification Bot

This application allows clients to register with a notification bot that will send them an instant message each time a particular stock price changes. The following code waits for a stock price change event to occur and then triggers the OnStockPriceChangeEvent routine.

Within the OnStockPriceChangeEvent routine, a while loop is used to iterate through the list of contacts by using the EnumerateBuddies method. Within the while loop, each IRTCBuddy object is checked to see if the associated contact is online. If the contact is online, a single party IM session is created and then the appropriate message is generated and sent to the client.

Upon receiving the SessionOperationComplete event, the application then terminates the session. A pointer to an IRTCSession object is extracted from the IRTCSessionOperationCompleteEvent object that was passed to the event using the get_Session property. Then the Terminate method is used to terminate the session.

Scenario 2: Interactive Bot

In this scenario, an interactive bot waits for clients to connect and then accepts messages from the clients. After the message is decoded, a response to the message is prepared and returned to the client. As this application could have hundreds of simultaneous IM sessions, it is important to distribute the work across multiple threads.

As part of the initialization process, the RTCClient object is set to automatically accept incoming sessions.

When a message arrives from a client, the OnMessageEvent is called. This routine extracts various pieces of information about the client's message including the session object and the client's name, as well as the type and text of the message. If the type of message is RTCMSET_MESSAGE, then the information in the message is parsed to determine how it should be processed. In this example, messages must begin with QUERYDB in order to be processed.

Rather than process messages inline, the information related to the message is added to a list for processing and a command is posted to a worker thread indicating that there is a new message waiting to be processed. This leaves the main thread free to continue to accept RTC requests as they come in, making the entire application more responsive.

The worker thread waits for messages to be sent. When it receives a message, it translates the message and generates a response. Then a command is posted to the main RTC client thread indicating that the response to the message has been generated and it should be sent to the client.

When the main thread receives the command from the worker thread stating that the response is ready to send, the session is retrieved from the list of sessions and the message is returned to the client.

Scenario 3: Web-Based User Interface

When you build a Web-based user interface, it is very important to distribute the RTCClient objects among multiple threads. Distributing the RTCClient objects among multiple threads limits the amount of work that any one thread has to perform, which allows the application to scale and handle large numbers of clients. In the main thread, requests are received and dispatched to a worker thread that will create the RTCClient object.

This routine looks for a worker thread with less than 10 RTCClient objects already allocated. If it can't find a worker thread with less than 10 RTCClient objects, a new thread will be created. In either case, a message containing a command to create a new client is passed to the thread.

The main thread is still responsible for updating the Web user interface, so each of the worker threads uses the UpdateCallBack event to send information back to the main thread.

In the worker thread, messages are received and decoded to determine which function should be performed. For example, a WM_CREATECLIENT message results in the CreateAndLogon routine being called. Other messages trigger other routines within the worker thread. Also a reference to the callback routine is saved so that the worker thread can post commands with relevant information to the main thread and update the Web user interface through the callback routine.

The CreateAndLogon routine creates a new instance of the RTCClient2 object and then performs any other tasks needed to initialize the client session.

As RTC events occur, the following event handler is called. This event handler lives in the worker thread because RTC interface pointers can't be used across threads. Depending on the event that was triggered, the event handler can request that the main thread return information to the client by the callback routine.

Conclusion

Building a scalable application is often based on looking for facilities that the application doesn't need or use, and then turning them off. Although saving a few bytes of memory here and there might be insignificant to an application servicing one user, the savings can really add up when multiplied by hundreds or thousands of users. Using the techniques described in this paper, you can design scalable RTC applications to meet the needs of any organization.

Related Links

See the following resources for further information:

More by: 1 The AMS C# Client API is supplied as strong-named. The AMS C# Client API is supplied as strong-named.NET assembly and is fully Common Language Specification (CLS) compliant. All types in the API are declared within the AMSClassLibrary namespace. Size: 942.6 KB, Price: Free, License: Freeware, Author: Aculab (aculab.com) 2 VertexFX E-Broker is one of the VertexFX Trader’s Main Value add services, shipped with the system by default, developed over VertexFX Client API, to perform the Multi-Account Trading capability.

VertexFX E-Broker is one of the VertexFX Trader’s. Size: 5.4 MB, Price: USD $450.00, License: Shareware, Author: VertexFX e-Broker (finsys.com.pk) 3 IDAC: the best in BDE migration and rapid VCL client-server/n-tier development Luxena Informix Data Access Components highlights This component set provides interaction between VCL (Delphi/CBuilder) based applications and Informix database. Size: 1.2 MB, Price: USD $149.00, License: Shareware, Author: Luxena Software Company (luxena.com) 4 Would you like to know how to create MySQL client applications using Visual C with MySQL C API? Would you like to know how to create MySQL client applications using Visual C with MySQL C API?What is MySQL? The MySQL database server is the world's. Size: 30.7 KB, Price: Free, License: Freeware, Author: ICT eBooks by Yeoh HS (yeohhs.com), 5 FTP client component library for Xbase+ provides direct and simple control of the FTP protocol from an Xbase application program.

Transfer, rename, delete, list, and append files. Create and remove server directories. Supports proxy servers. The MarshallSoft. Size: 407.0 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 6 FTP client Delphi component that provides direct and simple control of the FTP protocol from any 32 or 64 bit Delphi or.NET application program. Transfer, rename, delete, list, and append files.

Create and remove server directories. Royalty free.

Size: 521.6 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 7 Multi-threaded FTP client with bookmarks, sync, scheduling and optional skins 3D-FTP is lightning fast FTP client with multi-threaded transfer engine providing up to 20x faster file transfers. You can browse and change directories while transferring. Size: 2.1 MB, Price: USD $39.95, License: Shareware, Author: SiteDesigner Technologies, Inc. (sitedesigner.com), 8 MsgAPI is an API for developers who need to integrate.msg file support and search into their applications. With MsgAPI, there is no requirement to install MAPI or the Outlook client. MsgViewer Pro is used worldwide by large corporations and governments.

Size: 1.9 MB, Price: USD $299.99, License: Shareware, Author: Encryptomatic LLC (encryptomatic.com), 9 JUV Client (so-called Java RTMP client) is a lightweight library (200kB jar) that provides RTMP/RTMPT-enabled server access API for Java applications. JUV Client (so-called Java RTMP client) is a lightweight library (200kB jar) that provides RTMP/RTMPT-enabled. Size: 472.1 KB, Price: USD $395.00, License: Commercial, Author: Smaxe Ltd (smaxe.com), 10 Pooka is an email client written in Java, using the Javamail API. Pooka is an email client written in Java, using the Javamail API.

It supports email through the IMAP (connected and disconnected) and POP3 protocols. Outgoing mail is sent using SMTP. Size: 2.9 MB, Price: Free, License: Freeware, Author: Allen Petersen (suberic.net), 11 FTP component dBASE library that provides direct and simple control of the FTP client protocol from a dBASE application program. Transfer, rename, delete, list, append files. Create and remove server directories. Supports proxy servers.

Royalty free. Size: 400.6 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 12 FTP client FoxPro component that provides direct and simple control of the FTP protocol from any 32-bit Visual FoxPro application program. Transfer, rename, delete, list, and append files.

Create and remove server directories. Royalty free. The MarshallSoft. Size: 418.4 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 13 PowerBASIC FTP component library provides direct control of the FTP client protocol from an application.

Transfer files; upload, delete, list, append files. Create and delete server directories. Supports 32-bit PowerBASIC, Royalty free. Size: 401.4 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 14 Client Server winsock component VB library for TCP/IP network communication. Client/Server comm VB and VB.NET component library for TCP/IP winsock communication across a network such as the internet or intranet (LAN). CSC4VB uses the Windows API to communicate. Size: 262.0 KB, Price: USD $105.00, License: Shareware, Author: MarshallSoft Computing, Inc.

(marshallsoft.com), 15 Create proxy, chat, file transfer, HTTP, SMTP, POP3, FTP and DNS client programs. Royalty free. MarshallSoft Delphi and.NET TCP/IP and UDP/IP sockets client/server component for communication across a network such as the internet or intranet (LAN). Size: 557.1 KB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 16 Create proxy, chat, file transfer, HTTP, SMTP, POP3, FTP and DNS client programs.

MarshallSoft C and.NET client/server component library for TCP/IP and UDP/IP winsock sockets communication across a network such as the internet or intranet. Size: 1.7 MB, Price: USD $115.00, License: Shareware, Author: MarshallSoft Computing (marshallsoft.com), 17 HS FTP is a software library in C (supplied with full source code) which implements the client side of the File Transfer Protocol over TCP socket layer according to RFC 959 HS FTP is a software library in C (supplied with full source code) which implements. Size: 236.1 KB, Price: Free, License: Demo, Author: Hillstone Software (hillstone-software.com), 18 NET is a lightweight professional API for the Microsoft.NET framework.

The product is written using 1000% managed C#, is compatible with all versions of the framework and supports SSH1, SSH2, SFTP and SCP. No external dependencies. Maverick.NET is a. Size: 4.8 MB, Price: USD $570.00, EUR 440, License: Shareware, Author: 3SP Ltd (3sp.com), 19 The SocketWrench Secure Edition consists of a library and ActiveX control which uses the Windows Sockets API to provide basic TCP/IP networking functionality to your application.

Support for standard and secure (SSL) client and server connections. Size: 5.2 MB, Price: USD $195.00, License: Commercial, Author: Catalyst Development Corporation (sockettools.com), 20 The SocketWrench Standard Edition consists of a library and ActiveX control which uses the Windows Sockets API to provide basic TCP/IP networking functionality to your application. Support for standard client and server connections is included. The SocketWrench. Size: 5.1 MB, Price: USD $95.00, License: Commercial, Author: Catalyst Development Corporation (sockettools.com), 21 Create proxy, chat, file transfer, HTTP, SMTP, POP3, FTP and DNS client programs. MarshallSoft Visual FoxPro client/server component library for TCP/IP and UDP/IP winsock sockets communication across a network such as the internet or intranet (LAN).

Size: 468.7 KB, Price: USD $115.00, License: Demo, Author: MarshallSoft Computing (marshallsoft.com), 22 Adium is a free and open source instant messaging application for Mac OS X, written using Mac OS X's Cocoa API, released under the GNU GPL and developed by the Adium team Based on the libpurple protocol library, Adium can connect you to any number of. Size: 23.1 MB, Price: Free, License: Freeware, Author: adium (adium.im), 23 Tweetings is a small, Twitter client for Windows operating systems that runs from the system tray. Tweetings is a small, Twitter client for Windows operating systems that runs from the system tray. You will simply need to authorize the application from. Size: 3.3 MB, Price: Free, License: Freeware, Author: Dominion Web (dominion-web.com), 24 Tweetings is a small, Twitter client for Windows operating systems that runs from the system tray.

Tweetings is a small, Twitter client for Windows operating systems that runs from the system tray. You will simply need to authorize the application from.

Size: 3.3 MB, Price: Free, License: Freeware, Author: Dominion Web (dominion-web.com), 25 MindTerm is a powerful and easy to use secure remote access client that implements the SSH1 and SSH2 protocols. It is written in Java and is available both as a stand-alone application for end users and as a library component which can. Size: 1.2 MB, Price: Free, License: Freeware, Author: The Cryptzone Group (cryptzone.com),.