class wxTCPConnection: public wxConnectionBase
{
DECLARE_DYNAMIC_CLASS(wxTCPConnection)
-
+
protected:
wxSocketBase *m_sock;
wxSocketStream *m_sockstrm;
friend class wxTCPServer;
friend class wxTCPClient;
friend void Client_OnRequest(wxSocketBase&,
- GSocketEvent, char *);
+ wxSocketNotify, char *);
friend void Server_OnRequest(wxSocketServer&,
- GSocketEvent, char *);
+ wxSocketNotify, char *);
public:
wxTCPConnection(char *buffer, int size);
virtual ~wxTCPConnection();
// Calls that CLIENT can make
- bool Execute(wxChar *data, int size = -1,
+ bool Execute(const wxChar *data, int size = -1,
wxIPCFormat format = wxIPC_TEXT);
char *Request(const wxString& item, int *size = NULL,
wxIPCFormat format = wxIPC_TEXT);
// To enable the compressor
void Compress(bool on);
+private:
+ // to prevent virtual function hiding warnings
+ virtual bool Execute(const wxString& str) { return(wxConnectionBase::Execute(str)); };
};
class wxTCPServer: public wxServerBase
wxTCPServer();
virtual ~wxTCPServer();
-
+
// Returns FALSE if can't create server (e.g. port number is already in use)
- virtual bool Create(const wxString& server_name);
+ virtual bool Create(const wxString& server_name);
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic);
};
{
DECLARE_DYNAMIC_CLASS(wxTCPClient)
-public:
+public:
wxTCPClient();
virtual ~wxTCPClient();
virtual wxConnectionBase *MakeConnection(const wxString& host,
const wxString& server,
const wxString& topic);
-
+
// Tailor this to return own connection.
virtual wxConnectionBase *OnMakeConnection();
};