]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/ipcservr.tex
added format parameter to File/DirName()
[wxWidgets.git] / docs / latex / wx / ipcservr.tex
... / ...
CommitLineData
1\section{\class{wxServer}}\label{wxddeserver}
2
3A wxServer object represents the server part of a client-server
4DDE-like (Dynamic Data Exchange) conversation. The actual
5DDE-based implementation using wxDDEServer is available on Windows
6only, but a platform-independent, socket-based version of this
7API is available using wxTCPServer, which has the same API.
8
9To create a server which can communicate with a suitable client,
10you need to derive a class from wxConnection and another from
11wxServer. The custom wxConnection class will intercept
12communications in a `conversation' with a client, and the custom
13wxServer is required so that a user-overridden \helpref{wxServer::OnAcceptConnection}{wxddeserveronacceptconnection}
14member can return a wxConnection of the required class, when a
15connection is made. Look at the IPC sample and the \helpref{Interprocess communications overview}{ipcoverview} for
16an example of how to do this.
17
18\wxheading{Derived from}
19
20wxServerBase
21
22\wxheading{Include files}
23
24<wx/ipc.h>
25
26\wxheading{See also}
27
28\helpref{wxClient}{wxddeclient},
29\helpref{wxConnection}{wxddeconnection}, \helpref{IPC
30overview}{ipcoverview}
31
32\latexignore{\rtfignore{\wxheading{Members}}}
33
34\membersection{wxServer::wxServer}
35
36\func{}{wxServer}{\void}
37
38Constructs a server object.
39
40\membersection{wxServer::Create}
41
42\func{bool}{Create}{\param{const wxString\& }{service}}
43
44Registers the server using the given service name. Under Unix,
45the service name may be either an integer port identifier in
46which case an Internet domain socket will be used for the
47communications, or a valid file name (which shouldn't exist and
48will be deleted afterwards) in which case a Unix domain socket is
49created. false is returned if the call failed (for example, the
50port number is already in use).
51
52\membersection{wxServer::OnAcceptConnection}\label{wxddeserveronacceptconnection}
53
54\func{virtual wxConnectionBase *}{OnAcceptConnection}{\param{const wxString\& }{topic}}
55
56When a client calls {\bf MakeConnection}, the server receives the
57message and this member is called. The application should derive a
58member to intercept this message and return a connection object of
59either the standard wxConnection type, or (more likely) of a
60user-derived type.
61
62If the topic is {\bf STDIO}, the application may wish to refuse the
63connection. Under UNIX, when a server is created the
64OnAcceptConnection message is always sent for standard input and
65output, but in the context of DDE messages it doesn't make a lot
66of sense.
67