Closing a Session

RFmx WCDMA 19.1 Help

Edition Date: October 2019

Part Number: 375421H-01

»View Product Info
Download Help (Windows Only)

RFmx provides the following methods to close a session.

public void Dispose()
public void Close()
public void ForceClose()

The Dispose and Close methods perform a reference counted close.

The following snippets show an example of closing a session using the Close method.

C#

//ref count is 0
RFmxInstrMX InstrSession1 = RFmxInstrMX.GetSession("Rfsa","");
RFmxInstrMX InstrSession2 = RFmxInstrMX.GetSession("Rfsa","");
RFmxInstrMX InstrSession3 = RFmxInstrMX.GetSession("Rfsa","");
//ref count is 3
InstrSession1.Close();
//ref count is 2. Session is not disposed yet.
InstrSession2.Close();
InstrSession3.Close();
//Session is closed when ref count hits 0.

VB

'ref count is 0
Dim InstrSession1 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
Dim InstrSession2 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
Dim InstrSession3 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
'ref count is 3
InstrSession1.Close()
'ref count is 2. Session is not disposed yet.
InstrSession2.Close()
InstrSession3.Close()
'Session is closed when ref count hits 0.

The ForceClose method closes a session irrespective of the reference count. The following snippets show an example of closing a session using the ForceClose method.

C#

//ref count is 0
RFmxInstrMX InstrSession1 = RFmxInstrMX.GetSession("Rfsa","");
RFmxInstrMX InstrSession2 = RFmxInstrMX.GetSession("Rfsa","");
RFmxInstrMX InstrSession3 =RFmxInstrMX.GetSession("Rfsa","");
//ref count is 3
InstrSession1.ForceClose();
//Session is closed irrespective of reference count.

VB

'ref count is 0
Dim InstrSession1 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
Dim InstrSession2 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
Dim InstrSession3 As RFmxInstrMX = RFmxInstrMX.GetSession("Rfsa", "")
'ref count is 3
InstrSession1.ForceClose()
'Session is closed irrespective of reference count.

WAS THIS ARTICLE HELPFUL?

Not Helpful