GPRS connection and threads

Login to reply to this topic.
Thu, 2005-08-25 13:08
Joined: 2005-02-21
Forum posts: 47
Target: store an used IAP to the config file and reuse the same connection next time without user interaction.
Common question but with a trick.

IAP storing part is implemented like (pseudocode):
  sockserv.Connect();
  connection.Open(sockserv);
  connection.EnumerateConnections();
  connection.GetConnectionInfo( 1, inf );
  store( inf()iIapId );
I end up with some number in conf file.

Next time I want to avoid user interaction, I do:
  TCommDbConnPref connectPref;
  connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
  connectPref.SetDirection(ECommDbConnectionDirectionOutgoing);
  connectPref.SetIapId( setup.GetInt(SETUPKEY_UI_IAP) );
  connection.Start( connectPref );

But, the tricky part - the socket creation/connection takes place in another thread. And this thread asks for an IAP again ignoring the fact that there is a GPRS connection up and active already.

Do you have any solutions?

Ahti.

Thu, 2005-08-25 14:03
Joined: 2005-05-11
Forum posts: 83
Re: GPRS connection and threads
Start connection in same thread  Smiley
Thu, 2005-08-25 14:06
Joined: 2005-02-21
Forum posts: 47
Re: GPRS connection and threads

impossible. And not logical. If the TCP/IP connection is up - why RSocket does not use the one?

Ahti.

Thu, 2005-08-25 14:16
Joined: 2005-05-11
Forum posts: 83
Re: GPRS connection and threads
When you open socket you can set RConnetion what it use try it Smiley
You can send pointer to thread and you can use this pointer inside you thread.
  • Login to reply to this topic.