1 \section{\class{wxTCPClient
}}\label{wxtcpclient
}
3 A wxTCPClient object represents the client part of a client-server conversation.
4 It emulates a DDE-style protocol, but uses TCP/IP which is available on most platforms.
6 A DDE-based implementation for Windows is available using
\helpref{wxDDEClient
}{wxddeclient
}.
8 To create a client which can communicate with a suitable server,
9 you need to derive a class from wxTCPConnection and another from wxTCPClient.
10 The custom wxTCPConnection class will intercept communications in
11 a `conversation' with a server, and the custom wxTCPServer is required
12 so that a user-overridden
\helpref{wxTCPClient::OnMakeConnection
}{wxtcpclientonmakeconnection
} member can return
13 a wxTCPConnection of the required class, when a connection is made.
15 \wxheading{Derived from
}
18 \helpref{wxObject
}{wxobject
}
20 \wxheading{Include files
}
26 \helpref{wxNet
}{librarieslist
}
30 \helpref{wxTCPServer
}{wxtcpserver
},
\helpref{wxTCPConnection
}{wxtcpconnection
},
31 \helpref{Interprocess communications overview
}{ipcoverview
}
33 \latexignore{\rtfignore{\wxheading{Members
}}}
35 \membersection{wxTCPClient::wxTCPClient
}\label{wxtcpclientctor
}
37 \func{}{wxTCPClient
}{\void}
39 Constructs a client object.
41 \membersection{wxTCPClient::MakeConnection
}\label{wxtcpclientmakeconnection
}
43 \func{wxConnectionBase *
}{MakeConnection
}{\param{const wxString\&
}{host
},
\param{const wxString\&
}{service
},
\param{const wxString\&
}{topic
}}
45 Tries to make a connection with a server specified by the host
46 (a machine name under Unix), service name (must
47 contain an integer port number under Unix), and a topic string. If the
48 server allows a connection, a wxTCPConnection object will be returned.
49 The type of wxTCPConnection returned can be altered by overriding
50 the
\helpref{wxTCPClient::OnMakeConnection
}{wxtcpclientonmakeconnection
} member to return your own
51 derived connection object.
53 \membersection{wxTCPClient::OnMakeConnection
}\label{wxtcpclientonmakeconnection
}
55 \func{wxConnectionBase *
}{OnMakeConnection
}{\void}
57 The type of
\helpref{wxTCPConnection
}{wxtcpconnection
} returned from a
\helpref{wxTCPClient::MakeConnection
}{wxtcpclientmakeconnection
} call can
58 be altered by deriving the
{\bf OnMakeConnection
} member to return your
59 own derived connection object. By default, a wxTCPConnection
62 The advantage of deriving your own connection class is that it will
63 enable you to intercept messages initiated by the server, such
64 as
\helpref{wxTCPConnection::OnAdvise
}{wxtcpconnectiononadvise
}. You may also want to
65 store application-specific data in instances of the new class.
67 \membersection{wxTCPClient::ValidHost
}\label{wxtcpclientvalidhost
}
69 \func{bool
}{ValidHost
}{\param{const wxString\&
}{host
}}
71 Returns true if this is a valid host name, false otherwise.