]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/ipcservr.tex
define _HPUX_SOURCE under HP-UX, otherwise many things are not defined in standard...
[wxWidgets.git] / docs / latex / wx / ipcservr.tex
CommitLineData
f510b7b2 1\section{\class{wxServer}}\label{wxserver}
47610ec2
JS
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
39275175 13wxServer is required so that a user-overridden \helpref{wxServer::OnAcceptConnection}{wxserveronacceptconnection}
47610ec2
JS
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
f510b7b2 28\helpref{wxClient}{wxclient},
47610ec2
JS
29\helpref{wxConnection}{wxddeconnection}, \helpref{IPC
30overview}{ipcoverview}
31
32\latexignore{\rtfignore{\wxheading{Members}}}
33
39275175 34\membersection{wxServer::wxServer}\label{wxserverctor}
47610ec2
JS
35
36\func{}{wxServer}{\void}
37
38Constructs a server object.
39
39275175 40\membersection{wxServer::Create}\label{wxservercreate}
47610ec2
JS
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
cc81d32f 49created. false is returned if the call failed (for example, the
47610ec2
JS
50port number is already in use).
51
39275175 52\membersection{wxServer::OnAcceptConnection}\label{wxserveronacceptconnection}
47610ec2
JS
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