use buffered streams to reduce the number of TCP packets used per IPC command from up to 7 to 1 for reasonably sized payloads, this dramatically (by 150 times for the IPC benchmark on a LAN) increases performance; also centralize all the streams used in a single wxIPCSocketStreams class and allocate only it on the heap instead of doing it for all of the streams

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-29 16:45:55 +00:00
parent f42c1512dd
commit 8aea37a9df
3 changed files with 340 additions and 205 deletions

View File

@@ -52,6 +52,8 @@
class WXDLLIMPEXP_FWD_NET wxTCPServer;
class WXDLLIMPEXP_FWD_NET wxTCPClient;
class wxIPCSocketStreams;
class WXDLLIMPEXP_NET wxTCPConnection : public wxConnectionBase
{
public:
@@ -85,11 +87,19 @@ protected:
wxIPCFormat format);
wxSocketBase *m_sock;
wxSocketStream *m_sockstrm;
wxDataInputStream *m_codeci;
wxDataOutputStream *m_codeco;
wxString m_topic;
// notice that all the members below are only initialized once the
// connection is made, i.e. in MakeConnection() for the client objects and
// after OnAcceptConnection() in the server ones
// the underlying socket (wxSocketClient for IPC client and wxSocketServer
// for IPC server)
wxSocketBase *m_sock;
// various streams that we use
wxIPCSocketStreams *m_streams;
// the topic of this connection
wxString m_topic;
private:
// common part of both ctors