javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp
changeset 87 1627c337e51e
parent 64 0ea12c182930
equal deleted inserted replaced
80:d6dafc5d983f 87:1627c337e51e
   117 
   117 
   118 void HttpSessionClient::ConstructL(TInt aType, TInt aAPNId, TInt * apnerr)
   118 void HttpSessionClient::ConstructL(TInt aType, TInt aAPNId, TInt * apnerr)
   119 {
   119 {
   120     LOG(ESOCKET,EInfo,"+HttpSessionClient::ConstructL ");
   120     LOG(ESOCKET,EInfo,"+HttpSessionClient::ConstructL ");
   121 
   121 
       
   122     iApType = aType;
   122     /*CActiveScheduler * scheduler = new CActiveScheduler();
   123     /*CActiveScheduler * scheduler = new CActiveScheduler();
   123     CActiveScheduler::Install(scheduler);
   124     CActiveScheduler::Install(scheduler);
   124     CActiveScheduler::Add(this);*/
   125     CActiveScheduler::Add(this);*/
   125 
   126 
   126     iHttpSession.OpenL();
   127     iHttpSession.OpenL();
   186     else
   187     else
   187     {
   188     {
   188         if (aType == 3) // IAP Id
   189         if (aType == 3) // IAP Id
   189         {
   190         {
   190             LOG(ESOCKET,EInfo,"+HttpSessionClient:: in iap case");
   191             LOG(ESOCKET,EInfo,"+HttpSessionClient:: in iap case");
       
   192             iApnId = aAPNId;
   191             if (aAPNId != -1)
   193             if (aAPNId != -1)
   192             {
   194             {
   193                 // Creates connection with selected IAP ID
   195                 // Creates connection with selected IAP ID
   194                 int ret = iSocketServ.Connect();
   196                 int ret = iSocketServ.Connect();
   195                 if (ret < 0)
   197                 if (ret < 0)
   334         }
   336         }
   335 }*/
   337 }*/
   336 
   338 
   337 void HttpSessionClient::RestartConnection()
   339 void HttpSessionClient::RestartConnection()
   338 {
   340 {
   339     LOG(ESOCKET,EInfo,"+HttpSessionClient::RestartConnection12 + ");
   341     LOG2(ESOCKET,EInfo,"+HttpSessionClient::RestartConnection12 %d , type = %d ",iApnId,iApType);
   340     iConnection.Close();
   342     iConnection.Close();
   341     TInt ret = iConnection.Open(iSocketServ);
   343     TInt ret = iConnection.Open(iSocketServ);
   342 
   344 
   343     //TCommSnapPref connPref;
   345     //TCommSnapPref connPref;
   344 #ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS
   346 #ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS
   345     TConnPrefList prefList;
   347     TConnPrefList prefList;
   346     TExtendedConnPref prefs;
   348     TExtendedConnPref prefs;
   347 
   349 
   348     if (iApnId!=-1)
   350     if ((iApnId!=-1) && (iApType == 2))
   349         prefs.SetSnapId(iApnId);
   351         prefs.SetSnapId(iApnId);
       
   352     else if ((iApnId!=-1) && (iApType == 3))
       
   353         prefs.SetIapId(iApnId);
   350     TRAPD(err,prefList.AppendL(&prefs));
   354     TRAPD(err,prefList.AppendL(&prefs));
   351     if (err == KErrNone)
   355     if (err == KErrNone)
   352         ret = iConnection.Start(prefList);
   356         ret = iConnection.Start(prefList);
   353     else
   357     else
   354         ret = iConnection.Start();
   358         ret = iConnection.Start();
   355 #else
   359 #else
   356     TCommSnapPref connPref;
   360     if ((iApnId!=-1) && (iApType == 2)) // SNAP case
   357     if (iApnId!=-1)
   361     {
   358         connPref.SetSnap(iApnId);
   362     	  TCommSnapPref snapPref;
   359     ret = iConnection.Start(connPref);
   363         snapPref.SetSnap(iApnId);
   360 
   364         ret = iConnection.Start(snapPref);
       
   365     }
       
   366     else if ((iApnId!=-1) && (iApType == 3)) // IAP case
       
   367     {
       
   368     	  TCommDbConnPref iapPref;
       
   369         iapPref.SetIapId(iApnId);
       
   370         ret = iConnection.Start(iapPref);
       
   371     }
   361 #endif
   372 #endif
   362     LOG(ESOCKET,EInfo,"+HttpSessionClient::RestartConnection + ");
   373     ELOG1(ESOCKET,"+HttpSessionClient::RestartConnection --ret = %d ",ret);
   363 
   374 
   364 }
   375 }