no real changes, just reformat before starting really modifying

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-28 00:02:38 +00:00
parent 438febca6e
commit 7e73fb9c99
2 changed files with 503 additions and 508 deletions

View File

@@ -55,87 +55,94 @@ class WXDLLIMPEXP_FWD_NET wxTCPClient;
class WXDLLIMPEXP_NET wxTCPConnection : public wxConnectionBase class WXDLLIMPEXP_NET wxTCPConnection : public wxConnectionBase
{ {
public: public:
wxTCPConnection(void *buffer, size_t size); wxTCPConnection() { Init(); }
wxTCPConnection(); wxTCPConnection(void *buffer, size_t size)
virtual ~wxTCPConnection(); : wxConnectionBase(buffer, size)
{
Init();
}
// To enable the compressor (NOTE: not implemented!) virtual ~wxTCPConnection();
void Compress(bool on);
// implement base class pure virtual methods
virtual const void *Request(const wxString& item,
size_t *size = NULL,
wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
virtual bool StopAdvise(const wxString& item);
virtual bool Disconnect(void);
// Will be used in the future to enable the compression but does nothing
// for now.
void Compress(bool on);
// implement base class pure virtual methods
virtual const void *Request(const wxString& item,
size_t *size = NULL,
wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
virtual bool StopAdvise(const wxString& item);
virtual bool Disconnect(void);
protected: protected:
virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format); virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format);
virtual bool DoPoke(const wxString& item, const void *data, size_t size, virtual bool DoPoke(const wxString& item, const void *data, size_t size,
wxIPCFormat format);
virtual bool DoAdvise(const wxString& item, const void *data, size_t size,
wxIPCFormat format); wxIPCFormat format);
virtual bool DoAdvise(const wxString& item, const void *data, size_t size,
wxIPCFormat format);
wxSocketBase *m_sock; wxSocketBase *m_sock;
wxSocketStream *m_sockstrm; wxSocketStream *m_sockstrm;
wxDataInputStream *m_codeci; wxDataInputStream *m_codeci;
wxDataOutputStream *m_codeco; wxDataOutputStream *m_codeco;
wxString m_topic; wxString m_topic;
friend class wxTCPServer; private:
friend class wxTCPClient; // common part of both ctors
friend class wxTCPEventHandler; void Init();
DECLARE_NO_COPY_CLASS(wxTCPConnection) friend class wxTCPServer;
DECLARE_DYNAMIC_CLASS(wxTCPConnection) friend class wxTCPClient;
friend class wxTCPEventHandler;
DECLARE_NO_COPY_CLASS(wxTCPConnection)
DECLARE_DYNAMIC_CLASS(wxTCPConnection)
}; };
class WXDLLIMPEXP_NET wxTCPServer : public wxServerBase class WXDLLIMPEXP_NET wxTCPServer : public wxServerBase
{ {
public: public:
wxTCPServer(); wxTCPServer();
virtual ~wxTCPServer(); virtual ~wxTCPServer();
// Returns false on error (e.g. port number is already in use) // Returns false on error (e.g. port number is already in use)
virtual bool Create(const wxString& serverName); virtual bool Create(const wxString& serverName);
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic); virtual wxConnectionBase *OnAcceptConnection(const wxString& topic);
wxTCPConnection *topLevelConnection;
protected: protected:
wxSocketServer *m_server; wxSocketServer *m_server;
#ifdef __UNIX_LIKE__ #ifdef __UNIX_LIKE__
// the name of the file associated to the Unix domain socket, may be empty // the name of the file associated to the Unix domain socket, may be empty
wxString m_filename; wxString m_filename;
#endif // __UNIX_LIKE__ #endif // __UNIX_LIKE__
DECLARE_NO_COPY_CLASS(wxTCPServer) DECLARE_NO_COPY_CLASS(wxTCPServer)
DECLARE_DYNAMIC_CLASS(wxTCPServer) DECLARE_DYNAMIC_CLASS(wxTCPServer)
}; };
class WXDLLIMPEXP_NET wxTCPClient : public wxClientBase class WXDLLIMPEXP_NET wxTCPClient : public wxClientBase
{ {
public: public:
wxTCPClient(); wxTCPClient();
virtual ~wxTCPClient();
virtual bool ValidHost(const wxString& host); virtual bool ValidHost(const wxString& host);
// Call this to make a connection. Returns NULL if cannot. // Call this to make a connection. Returns NULL if cannot.
virtual wxConnectionBase *MakeConnection(const wxString& host, virtual wxConnectionBase *MakeConnection(const wxString& host,
const wxString& server, const wxString& server,
const wxString& topic); const wxString& topic);
// Callbacks to CLIENT - override at will // Callbacks to CLIENT - override at will
virtual wxConnectionBase *OnMakeConnection(); virtual wxConnectionBase *OnMakeConnection();
private: private:
DECLARE_DYNAMIC_CLASS(wxTCPClient) DECLARE_DYNAMIC_CLASS(wxTCPClient)
}; };
#endif // wxUSE_SOCKETS && wxUSE_IPC #endif // wxUSE_SOCKETS && wxUSE_IPC

File diff suppressed because it is too large Load Diff