[Cover] [Previous Section] [Next Section] [Index]

Current chapter: C++ Notification Library Reference
Section 34 out of 79 total sections , Section 4 out of 5 sections in this chapter


Secure notification (TNtfnSClient) class

The TNtfnSClient class is derived from the abstract base class described in Abstract base notification class (TNtfnClientAPI). You use it to send secure-only and "secure-preferred" notifications.

The constructor for TNtfnSClient class does not establish a network connection with the UP.Link server; the API automatically connects each time it needs to--that is, when you call a method inherited from the TNtfnClientAPI base class to perform an operation such as posting, querying, or deleting a notification.

The TNtfnSClient class supports an optional "secure-preferred" mode, which attempts to use the non-secure notification port if the secure notification port is disabled. If you do not use the secure-preferred mode, calls to post, query, or delete notifications will fail if the API can't access the secure port.

Once the API successfully makes a request in secure-preferred mode, it binds the protocol used for the request to the TNtfnSClient object; it uses the protocol for subsequent requests. Specifically, if the API successfully makes a request to the secure port, it will not subsequently attempt to fail over to the non-secure port if the secure port becomes inaccessible. To determine which protocol the API is using, call the TNtfnClientAPI method, GetProtocol() (see GetProtocol()).

The TNtfnSClient class uses a secure protocol based on HTTPS.

The public interface of the TNtfnSClient class is defined as follows:

where:

msgrHost  

The domain of the UP.Link server host to send notifications to. 

requireSecure  

Specifies whether to use "secure-preferred" mode and communicate on a non-secure port if the API is unable to connect with the secure port. Specify 0 to enable secure-preferred mode; specify a non-zero value to limit communication to a secure port. 

upnotifypsPor t  

The secure port on the UP.Link server to direct communication to. If you specify 0, the default secure port is used. Unwired Planet strongly recommends that you use the default secure port. 

upnotifypPort  

The non-secure port on the UP.Link server to direct communication to, if a communication with the port specified by upnotifypsPort fails. If you specify 0, the default non-secure port is used. Unwired Planet strongly recommends that you use the default non-secure port. 

filename  

The filename containing the certificate that you obtained from a certificate authority. 

passwd  

The password to decrypt the private key for the certificate. 

You must call LoadCertAndKey() before you attempt to post, delete, or obtain status on a notification. LoadCertAndKey() returns nonzero for success, or zero if the specified file is not accessible or is malformed, or if the password you specify is incorrect.


[Cover] [Previous Section] [Next Section] [Index]

Current chapter: C++ Notification Library Reference
Section 34 out of 79 total sections , Section 4 out of 5 sections in this chapter


Copyright © 1999, Unwired Planet, Inc. All rights reserved.