contents up previous next

wxtcpserver

a wxtcpserver object represents the server part of a client-server conversation. it emulates a dde-style protocol, but uses tcp/ip which is available on most platforms.

a dde-based implementation for windows is available using wxddeserver.

derived from

wxserverbase
wxobject

include files

<wx/sckipc.h>

see also

wxtcpclient, wxtcpconnection, ipc overview

members

wxtcpserver::wxtcpserver
wxtcpserver::create
wxtcpserver::onacceptconnection


wxtcpserver::wxtcpserver

wxtcpserver()

constructs a server object.


wxtcpserver::create

bool create(const wxstring& service)

registers the server using the given service name. under unix, the string must contain an integer id which is used as an internet port number. false is returned if the call failed (for example, the port number is already in use).


wxtcpserver::onacceptconnection

virtual wxconnectionbase * onacceptconnection(const wxstring& topic)

when a client calls makeconnection, the server receives the message and this member is called. the application should derive a member to intercept this message and return a connection object of either the standard wxtcpconnection type, or of a user-derived type. if the topic is "stdio'', the application may wish to refuse the connection. under unix, when a server is created the onacceptconnection message is always sent for standard input and output.