Symbian
Symbian OS Library

FAQ-0773 Why does calling Close() or Shutdown() on my RSocket session not result in termination of my dial-up connection

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Networking
Created: 01/28/2002 Modified: 02/13/2002
Number: FAQ-0773
Platform: ER5, Symbian OS v6.0, Symbian OS v6.1

Question:
When I call Close() or Shutdown() on my RSocket session, termination of my dial-up connection only occurs after a lengthy delay. Why is this and what can I do about it?

Answer:
The timeout which is applied before terminating a dialup connection is a user-specified quantity. On the Nokia 9210, for example, the default value is 5 minutes. As long as an RSocketServ session with the Symbian OS socket server remains connected, this timeout will be applied. The correct way to indicate in your code that you no longer need the dialup connection is to close both the RSocket and the associated RSocketServ session. If there are no other RSocketServ sessions currently connected on the device, the dialup connection will be terminated almost immediately. But if another process still has an RSocketServ session open, this will be respected and the dialup connection will remain open, subject to the timeout condition.

    In v6.x, if you need to override this behaviour and terminate the dialup connection unconditionally, this is also possible using RNif functionality (see below). However, because of the unforeseen disruption this may cause to other applications or processes, it is not a recommended practice.

    RNif nif;
    if (nif.Open() == KErrNone)
       {
       nif.Stop();
       nif.Close();
       }