|
下列代码演示了如何在RHTTPSession对象上增加一个由RConnection生成的连接: Code:
RConnection connection; RSocketServ socketServ; RHTTPSession session; User::LeaveIfError(socketServ.Connect()); User::LeaveIfError(connection.Open( socketServ )); User::LeaveIfError(onnection.Start()) session.OpenL(); RHTTPConnectionInfo connInfo = iSession.ConnectionInfo(); RStringPool pool = iSession.StringPool(); connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle())); connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), HTTPHdrVal(iConnect.SubSessionHandle())); session.OpenTransactionL(...); |