diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-7FAE6FE0-D5CB-55D4-94B0-ADD545577CA7.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-7FAE6FE0-D5CB-55D4-94B0-ADD545577CA7.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,79 @@ + + + + + + Creating and setting properties for a Sub-Connection: Tutorial

This tutorial shows how an application can create Quality of Service properties and assign them to a sub-connection.

Error handling is not included to aid clarity.

// Create the container for all sub connection parameters +RSubConParameterBundle subconParams; +CleanupClosePushL(subconParams); + +// Create a container for QoS sub connection parameters (Param bundle takes ownership) +CSubConParameterFamily* qosFamily = CSubConParameterFamily::NewL(subconParams, + KSubConQoSFamily); + +// Create the requested generic parameter set for QoS (Qos family takes ownership) +CSubConQosGenericParamSet* reqGenericParams = CSubConQosGenericParamSet::NewL(*qosFamily, + CSubConParameterFamily::ERequested); + +// Set the requested Generic Parameters +reqGenericParams->SetDownlinkBandwidth(128); +reqGenericParams->SetUplinkBandwidth(64); + +// Create the acceptable generic parameter set for QoS (Qos family takes ownership) +CSubConQosGenericParamSet* accGenericParams = CSubConQosGenericParamSet::NewL(*qosFamily, + CSubConParameterFamily::EAcceptable); + +// Set the acceptable Generic Parameters +accGenericParams->SetDownlinkBandwidth(48); +accGenericParams->SetUplinkBandwidth(32); + +// Create a requested technology specific parameter set for QoS (Qos family takes ownership) +CSubConQosR99ParamSet* reqRel99Params = CSubConQosR99ParamSet::NewL(*qosFamily, + CSubConParameterFamily::ERequested); + +// Set the requested Technology Specific Params +reqRel99Params->SetMaxSDUSize(1024); + +// Create a acceptable technology specific parameter set for QoS (Qos family takes ownership) +CSubConQosR99ParamSet* accRel99Params = CSubConQosR99ParamSet::NewL(*qosFamily, + CSubConParameterFamily::EAcceptable); + +// Set the acceptable Technology Specific Params +accRel99Params->SetMaxSDUSize(512); + +// Now open the sub-connection as normal… +……… +……… +// Create a new sub-connection +subconn.Open(ss, RSubConnection::ECreateNew, conn); + +// Set Properties of the sub-connection +subconn.SetParameters(subconParams); + +// Destroy parameters +CleanupStack::PopAndDestroy(); // subconParams + +// Open a TCP socket on the sub-connection +sock.Open(ss, KAfInet, KSockStream, KProtocolInetTcp, subconn); + +_LIT(KRasAddr,"10.159.24.13"); +const TInt KEchoPort = 7; + +TInetAddr destAddr; +destAddr.Input(KRasAddr); +destAddr.SetPort(KEchoPort); + +// Connect the Socket to the destination over the sub-connection +sock.Connect(destAddr, status); +User::WaitForRequest(status); + +// Fetch the granted qos +RSubConParameterBundle grantedParams; +subconn.GetParameters(grantedParams); +
\ No newline at end of file