⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipcclint.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
\section{\class{wxClient}}\label{wxclient}A wxClient object represents the client part of a client-serverDDE-like (Dynamic Data Exchange) conversation. The actualDDE-based implementation using wxDDEClient is available on Windowsonly, but a platform-independent, socket-based version of thisAPI is available using wxTCPClient, which has the same API.To create a client which can communicate with a suitable server,you need to derive a class from wxConnection and another fromwxClient. The custom wxConnection class will interceptcommunications in a `conversation' with a server, and the customwxClient is required so that a user-overridden\helpref{wxClient::OnMakeConnection}{wxclientonmakeconnection} member can return a wxConnection of the required class, when aconnection is made. Look at the IPC sample and the \helpref{Interprocess communications overview}{ipcoverview} foran example of how to do this.\wxheading{Derived from}wxClientBase\\\helpref{wxObject}{wxobject}\wxheading{Include files}<wx/ipc.h>\wxheading{See also}\helpref{wxServer}{wxserver}, \helpref{wxConnection}{wxconnection}, \helpref{Interprocess communications overview}{ipcoverview}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxClient::wxClient}\label{wxclientctor}\func{}{wxClient}{\void}Constructs a client object.\membersection{wxClient::MakeConnection}\label{wxclientmakeconnection}\func{wxConnectionBase *}{MakeConnection}{\param{const wxString\& }{host}, \param{const wxString\& }{service}, \param{const wxString\& }{topic}}Tries to make a connection with a server by host (machine nameunder UNIX - use 'localhost' for same machine; ignored when usingnative DDE in Windows), service name and topic string. If theserver allows a connection, a wxConnection object will bereturned. The type of wxConnection returned can be altered byoverriding the \helpref{wxClient::OnMakeConnection}{wxclientonmakeconnection} member to return your own derived connection object.Under Unix, the service name may be either an integer portidentifier in which case an Internet domain socket will be usedfor the communications, or a valid file name (which shouldn'texist and will be deleted afterwards) in which case a Unix domainsocket is created.{\bf SECURITY NOTE:} Using Internet domain sockets if extremelyinsecure for IPC as there is absolutely no access control forthem, use Unix domain sockets whenever possible!\membersection{wxClient::OnMakeConnection}\label{wxclientonmakeconnection}\func{wxConnectionBase *}{OnMakeConnection}{\void}Called by \helpref{wxClient::MakeConnection}{wxclientmakeconnection}, bydefault this simply returns a new wxConnection object. Overridethis method to return a wxConnection descendant customised for theapplication.The advantage of deriving your own connection class is that itwill enable you to intercept messages initiated by the server,such as \helpref{wxConnection::OnAdvise}{wxconnectiononadvise}. Youmay also want to store application-specific data in instances ofthe new class.\membersection{wxClient::ValidHost}\label{wxclientvalidhost}\func{bool}{ValidHost}{\param{const wxString\& }{host}}Returns true if this is a valid host name, false otherwise. This alwaysreturns true under MS Windows.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -