wxConnection: wxObject

A wxConnection object represents the connection between a client and a server. It can be created by making a connection using a client object, or by the acceptance of a connection by a server object. It implements the bulk of a DDE (Dynamic Data Exchange) conversation (available in both Windows and UNIX). See section [*].

wxConnection::wxConnection

voidwxConnection

voidwxConnectionchar *buffer, int size

Constructs a connection object. If no user-defined connection object is to be derived from wxConnection, then the constructor should not be called directly, since the default connection object will be provided on requesting (or accepting) a connection. However, if the user defines his or her own derived connection object, the Server::OnAcceptConnection and/or Client::OnMakeConnection members should be replaced by functions which construct the new connection object. If the arguments of the wxConnection constructor are void, then a default buffer is associated with the connection. Otherwise, the programmer must provide a a buffer and size of the buffer for the connection object to use in transactions.

wxConnection::Advise

BoolAdvisechar *item, char *data, int size = -1, int format = wxCF_TEXT

Called by the server application to advise the client of a change in the data associated with the given item. Causes the client connection's OnAdvise member to be called. Returns TRUE if successful.

wxConnection::Execute

BoolExecutechar *data, int size = -1, int format = wxCF_TEXT

Called by the client application to execute a command on the server. Can also be used to transfer arbitrary data to the server (similar to Poke in that respect). Causes the server connection's OnExecute member to be called. Returns TRUE if successful.

wxConnection::Disconnect

BoolDisconnect

Called by the client or server application to disconnect from the other program; it causes the OnDisconnect message to be sent to the corresponding connection object in the other program. The default behaviour of OnDisconnect is to delete the connection, but the calling application must explicitly delete its side of the connection having called Disconnect. Returns TRUE if successful.

wxConnection::OnAdvise

BoolOnAdvisechar *topic, char *item, char *data, int size, int format

Message sent to the client application when the server notifies it of a change in the data associated with the given item.

wxConnection::OnDisconnect

BoolOnDisconnect

Message sent to the client or server application when the other application notifies it to delete the connection. Default behaviour is to delete the connection object.

wxConnection::OnExecute

BoolOnExecutechar *topic, char *data, int size, int format

Message sent to the server application when the client notifies it to execute the given data. Note that there is no item associated with this message.

wxConnection::OnPoke

BoolOnPokechar *topic, char *item, char *data, int size, int format

Message sent to the server application when the client notifies it to accept the given data.

wxConnection::OnRequest

char *OnRequestchar *topic, char *item, int *size, int format

Message sent to the server application when the client calls Request. The server should respond by returning a character string from OnRequest, or NULL to indicate no data.

wxConnection::OnStartAdvise

BoolOnStartAdvisechar *topic, char *item

Message sent to the server application by the client, when the client wishes to start an `advise loop' for the given topic and item. The server can refuse to participate by returning FALSE.

wxConnection::OnStopAdvise

BoolOnStopAdvisechar *topic, char *item

Message sent to the server application by the client, when the client wishes to stop an `advise loop' for the given topic and item. The server can refuse to stop the advise loop by returning FALSE, although this doesn't have much meaning in practice.

wxConnection::Poke

BoolPokechar *item, char *data, int size = -1, int format = wxCF_TEXT

Called by the client application to poke data into the server. Can be used to transfer arbitrary data to the server. Causes the server connection's OnPoke member to be called. Returns TRUE if successful.

wxConnection::Request

char *Requestchar *item, int *size, int format = wxCF_TEXT

Called by the client application to request data from the server. Causes the server connection's OnRequest member to be called. Returns a character string (actually a pointer to the connection's buffer) if successful, NULL otherwise.

wxConnection::StartAdvise

BoolStartAdvisechar *item

Called by the client application to ask if an advise loop can be started with the server. Causes the server connection's OnStartAdvise member to be called. Returns TRUE if the server okays it, FALSE otherwise.

wxConnection::StopAdvise

BoolStopAdvisechar *item

Called by the client application to ask if an advise loop can be stopped. Causes the server connection's OnStopAdvise member to be called. Returns TRUE if the server okays it, FALSE otherwise.