You Are Here:

Community: Wiki

This page was last modified on 29 October 2008, at 14:51.

TSS000200 - Handling the leave when opening an HTTP session

From Forum Nokia Wiki


ID TSS000200 Creation date April 7, 2005
Platform S60 2nd Edition Devices
Category Symbian C++ Subcategory Networking, HTTP


Keywords (APIs, classes, methods, functions):

Overview

Handling the leave when opening an HTTP session

Description

RHTTPSession::OpenL leaves with KErrNotFound if the Internet AP is not correctly configured - this is probably the first problem anyone encounters when using the HTTP API on a device because OpenL works with most SDKs on the emulator with default AP configuration.

The solution is to TRAP the leave and instruct the user to configure the Internet AP.

// Open RHTTPSession with default protocol ("HTTP/TCP")
TRAPD(err, iSession.OpenL());
if(err != KErrNone)
&nbsp;&nbsp;&nbsp;&nbsp; <nowiki>{</nowiki>
&nbsp;&nbsp;&nbsp; // Most common error; no access point configured, and
&nbsp;&nbsp;&nbsp; // session creation leaves with KErrNotFound.
&nbsp;&nbsp;&nbsp; _LIT(KErrMsg, "Cannot create session. Is internet access point configured?");
&nbsp;&nbsp;&nbsp; _LIT(KExitingApp, "Exiting app.");
&nbsp;&nbsp;&nbsp; CEikonEnv::Static()-<nowiki>></nowiki>InfoWinL(KErrMsg, KExitingApp);
&nbsp;&nbsp;&nbsp; User::Leave(err);
&nbsp;&nbsp;&nbsp; <nowiki>}</nowiki>

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS001332E5fE2dE5fE44eletingE5fmessagesE5fstoredE5fonE5fSIME5fcardX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZKnowledgeBaseContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZTechnicalSolutionQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZmessagingQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZKnowledgeBaseContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZTechnicalSolutionQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxmessagingX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZKnowledgeBaseContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZTechnicalSolutionQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ