WEB开发网      婵犻潧鍊婚弲顐︽偟椤栨稓闄勯柦妯侯槸閻庤霉濠婂骸浜剧紒杈ㄥ笚閹峰懘鎮╅崹顐ゆ殸婵炴垶鎸撮崑鎾趁归悩鐑橆棄闁搞劌瀛╃粋宥夘敃閿濆柊锕傛煙鐎涙ê鐏f繝濠冨灴閹啴宕熼鍡╀紘婵炲濮惧Λ鍕叏閳哄懎绀夋繛鎴濈-楠炪垽鎮归崶褍妲婚柛銊ュ缁傚秹鏁撻敓锟� ---闂佹寧娲╅幏锟�
开发学院手机开发Symbian 开发 Symbian OS中的Client/Server机制分析 阅读

Symbian OS中的Client/Server机制分析

 2010-09-06 08:10:00 来源:WEB开发网 闂侀潧妫撮幏锟�闂佸憡鍨电换鎰版儍椤掑倵鍋撳☉娆嶄沪缂傚稄鎷�婵犫拃鍛粶闁靛洤娲ㄩ埀顒佺⊕閵囩偟绱為敓锟�闂侀潧妫撮幏锟�  闂佺ǹ绻楀▍鏇㈠极閻愭娑樷枎閹邦剛娉氶梺鍛婎殔濞层劌鈻撻幋婵愬殫妞ゆ梻鍘х憴锟�
核心提示:RSessionBase::CreateSession() variants that take a server handle.@return The handle to the server.*/inline RServer2 Server() const { return iServer; }protected:
RSessionBase::CreateSession() variants that take a server handle.

@return The handle to the server.

*/

inline RServer2 Server() const { return iServer; }

protected:

inline const RMessage2& Message() const;

IMPORT_C CServer2(TInt aPriority, TServerType aType=EUnsharableSessions);

IMPORT_C void DoCancel();

IMPORT_C void RunL();

IMPORT_C TInt RunError(TInt aError);

private:

/**

Creates a server-side session object.

The session represents a communication link between a client and a server, and its creation is initiated by the client through a call to one of the RSessionBase::CreateSession() variants.

A server must provide an implementation, which as a minimum should:

- check that the version of the server is compatible with the client by comparing the client supplied version number against the server's version number; it should leave if there is incompatibility.

- construct and return the server side client session object.

@param aVersion The version information supplied by the client.

@param aMessage Represents the details of the client request that is requesting the creation of the session.

@return A pointer to the newly created server-side session object.

@see User::QueryVersionSupported()

*/

IMPORT_C virtual CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const =0;

...

...

};

有两个API需要我们注意一下:

IMPORT_C void StartL(const TDesC& aName);

SDK 中描述是把指定名称的Server加入到AS中,并且触发一个请求。一般这个函数会在我们自己写的类的ConstructL()中调用。因为 CServer2是从CActive派生的,所以我们可以猜测在StartL中,会触发一个请求,然后调用CActive的方法SetActive来表明 AO启动了请求。

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Symbian OS Client

编辑录入:coldstar [复制链接] [打 印]
赞助商链接