]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/tcpclint.tex
* Stream doc.
[wxWidgets.git] / docs / latex / wx / tcpclint.tex
CommitLineData
e2a6f233
JS
1\section{\class{wxTCPClient}}\label{wxtcpclient}
2
3A wxTCPClient object represents the client part of a client-server conversation.
4It emulates a DDE-style protocol, but uses TCP/IP which is available on most platforms.
5
6A DDE-based implementation for Windows is available using \helpref{wxDDEClient}{wxddeclient}.
7
8To create a client which can communicate with a suitable server,
9you need to derive a class from wxTCPConnection and another from wxTCPClient.
10The custom wxTCPConnection class will intercept communications in
11a `conversation' with a server, and the custom wxTCPServer is required
12so that a user-overriden \helpref{wxTCPClient::OnMakeConnection}{wxtcpclientonmakeconnection} member can return
13a wxTCPConnection of the required class, when a connection is made.
14
15\wxheading{Derived from}
16
17wxClientBase\\
18\helpref{wxObject}{wxobject}
19
20\wxheading{See also}
21
22\helpref{wxTCPServer}{wxtcpserver}, \helpref{wxTCPConnection}{wxtcpconnection},
23\helpref{Interprocess communications overview}{ipcoverview}
24
25\latexignore{\rtfignore{\wxheading{Members}}}
26
27\membersection{wxTCPClient::wxTCPClient}
28
29\func{}{wxTCPClient}{\void}
30
31Constructs a client object.
32
33\membersection{wxTCPClient::MakeConnection}\label{wxtcpclientmakeconnection}
34
35\func{wxConnectionBase *}{MakeConnection}{\param{const wxString\& }{host}, \param{const wxString\& }{service}, \param{const wxString\& }{topic}}
36
37Tries to make a connection with a server specified by the host
38(a machine name under Unix), service name (must
39contain an integer port number under Unix), and a topic string. If the
40server allows a connection, a wxTCPConnection object will be returned.
41The type of wxTCPConnection returned can be altered by overriding
42the \helpref{wxTCPClient::OnMakeConnection}{wxtcpclientonmakeconnection} member to return your own
43derived connection object.
44
45\membersection{wxTCPClient::OnMakeConnection}\label{wxtcpclientonmakeconnection}
46
47\func{wxConnectionBase *}{OnMakeConnection}{\void}
48
49The type of \helpref{wxTCPConnection}{wxtcpconnection} returned from a \helpref{wxTCPClient::MakeConnection}{wxtcpclientmakeconnection} call can
50be altered by deriving the {\bf OnMakeConnection} member to return your
51own derived connection object. By default, a wxTCPConnection
52object is returned.
53
54The advantage of deriving your own connection class is that it will
55enable you to intercept messages initiated by the server, such
56as \helpref{wxTCPConnection::OnAdvise}{wxtcpconnectiononadvise}. You may also want to
57store application-specific data in instances of the new class.
58
59\membersection{wxTCPClient::ValidHost}
60
61\func{bool}{ValidHost}{\param{const wxString\& }{host}}
62
63Returns TRUE if this is a valid host name, FALSE otherwise.
64