diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-F67F8930-7F8A-5497-AAD9-D7789B437478.dita --- a/Symbian3/PDK/Source/GUID-F67F8930-7F8A-5497-AAD9-D7789B437478.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-F67F8930-7F8A-5497-AAD9-D7789B437478.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,46 +1,46 @@ - - - - - -Creating a new sub-connection - Socket connected over the sub-connection

The following example shows how an application can use a sub-connection explicitly via an RSubConnection instance, and tie an RSocket to the sub-connection that has had its properties set. The socket is connected over the sub-connection in this case (if the underlying technology allows this).

RSocketServ ss; -RConnection conn; -RSubConnection subconn; -RSocket sock; -TRequestStatus status; - -// Connect to ESOCK -ss.Connect(); - -// Open an Connection -conn.Open(ss, KAfInet); - -// Start the connection -conn.Start(status); -User::WaitForRequest(status); - -// Create a new sub-connection -subconn.Open(ss, RSubConnection::ECreateNew, conn); - -// Set Properties of the sub-connection -subconn.SetParameters(…); - -// 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); - -// Request the Socket to connect to the destination over the sub-connection -sock.Connect(destAddr, status); + + + + + +Creating a new sub-connection - Socket connected over the sub-connection

The following example shows how an application can use a sub-connection explicitly via an RSubConnection instance, and tie an RSocket to the sub-connection that has had its properties set. The socket is connected over the sub-connection in this case (if the underlying technology allows this).

RSocketServ ss; +RConnection conn; +RSubConnection subconn; +RSocket sock; +TRequestStatus status; + +// Connect to ESOCK +ss.Connect(); + +// Open an Connection +conn.Open(ss, KAfInet); + +// Start the connection +conn.Start(status); +User::WaitForRequest(status); + +// Create a new sub-connection +subconn.Open(ss, RSubConnection::ECreateNew, conn); + +// Set Properties of the sub-connection +subconn.SetParameters(…); + +// 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); + +// Request the Socket to connect to the destination over the sub-connection +sock.Connect(destAddr, status);

Note: Error handling is not included to aid clarity.

\ No newline at end of file