X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15b6757b26a0277472a4f6b071b52050abd922da..877b5c30d6390744e4fc010c538fc6708251f7a8:/docs/doxygen/overviews/ipc.h?ds=sidebyside diff --git a/docs/doxygen/overviews/ipc.h b/docs/doxygen/overviews/ipc.h index 2fd2a44fe1..571cbcf377 100644 --- a/docs/doxygen/overviews/ipc.h +++ b/docs/doxygen/overviews/ipc.h @@ -7,9 +7,9 @@ ///////////////////////////////////////////////////////////////////////////// /*! - + @page ipc_overview Interprocess communication overview - + Classes: #wxServer, #wxConnection, #wxClient @@ -17,16 +17,16 @@ interprocess communication and network programming. This section only discusses one family of classes -- the DDE-like protocol -- but here's a list of other useful classes: - - + + #wxSocketEvent, #wxSocketBase, #wxSocketClient, #wxSocketServer: classes for the low-level TCP/IP API. #wxProtocol, #wxURL, #wxFTP, #wxHTTP: classes for programming popular Internet protocols. - - + + wxWidgets' DDE-like protocol is a high-level protocol based on Windows DDE. There are two implementations of this DDE-like protocol: one using real DDE running on Windows only, and another @@ -47,8 +47,8 @@ equivalent wxTCP... and wxDDE... classes can be used in much the same way. Three classes are central to the DDE-like API: - - + + wxClient. This represents the client application, and is used only within a client program. wxServer. This represents the server application, and is used @@ -57,8 +57,8 @@ client to the server - both the client and the server use an instance of this class, one per connection. Most DDE transactions operate on this object. - - + + Messages between applications are usually identified by three variables: connection object, topic name and item name. A data string is a fourth element of some messages. To create a @@ -82,8 +82,8 @@ overriding virtual functions in your class derived from wxConnection allows you to handle the DDE messages. To create a working server, the programmer must: - - + + Derive a class from wxConnection, providing handlers for various messages sent to the server side of a wxConnection (e.g. OnExecute, OnRequest, OnPoke). Only the handlers actually required by the application need to be @@ -94,11 +94,11 @@ derived connection class if the connection is accepted. Create an instance of your server object and call Create to activate it, giving it a service name. - - + + To create a working client, the programmer must: - - + + Derive a class from wxConnection, providing handlers for various messages sent to the client side of a wxConnection (e.g. OnAdvise). Only the handlers actually required by the application @@ -115,19 +115,19 @@ a connection object of the derived class if the connection is successful. Use the wxConnection member functions to send messages to the server. - - + + @ref datatransfer_overview #Examples @ref ddedetails_overview - - + + @section datatransfer Data transfer - + These are the ways that data can be transferred from one application to another. These are methods of wxConnection. - - + + @b Execute: the client calls the server with a data string representing a command to be executed. This succeeds or fails, depending on the server's willingness to answer. If the client wants to find the result @@ -143,22 +143,22 @@ @b Advise: The client asks to be advised of any change in data associated with a particular item. If the server agrees, the server will send an OnAdvise message to the client along with the item and data. - - + + The default data type is wxCF_TEXT (ASCII text), and the default data size is the length of the null-terminated string. Windows-specific data types could also be used on the PC. - + @section ipcexamples Examples - + See the sample programs @e server and @e client in the IPC samples directory. Run the server, then the client. This demonstrates using the Execute, Request, and Poke commands from the client, together with an Advise loop: selecting an item in the server list box causes that item to be highlighted in the client list box. - + @section ddedetails More DDE details - + A wxClient object initiates the client part of a client-server DDE-like (Dynamic Data Exchange) conversation (available in both Windows and Unix). @@ -171,7 +171,7 @@ member can return a wxConnection of the required class, when a connection is made. For example: - + @code class MyConnection: public wxConnection { public: @@ -180,14 +180,14 @@ bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format) { wxMessageBox(topic, data); } }; - + class MyClient: public wxClient { public: MyClient(void) {} wxConnectionBase *OnMakeConnection(void) { return new MyConnection; } }; @endcode - + Here, @b MyConnection will respond to #OnAdvise messages sent by the server by displaying a message box. @@ -201,16 +201,16 @@ request for a connection is accepted, and the client then requests an @e Advise loop from the server (an Advise loop is where the server calls the client when data has changed). - + @code wxString server = "4242"; wxString hostName; wxGetHostName(hostName); - + // Create a new client MyClient *client = new MyClient; connection = (MyConnection *)client-MakeConnection(hostName, server, "IPC TEST"); - + if (!connection) { wxMessageBox("Failed to make connection to server", "Client Demo Error"); @@ -218,7 +218,7 @@ } connection-StartAdvise("Item"); @endcode - + */ - - + +