move Read/Write() to common code, there was almost nothing platform-specific in it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-27 22:49:46 +00:00
parent 62088a3c3b
commit 14372de82e
6 changed files with 173 additions and 365 deletions

View File

@@ -260,8 +260,11 @@ public:
// IO operations
// -------------
virtual int Read(void *buffer, int size) = 0;
virtual int Write(const void *buffer, int size) = 0;
// basic IO, work for both TCP and UDP sockets
//
// return the number of bytes read/written (possibly 0) or -1 on error
int Read(void *buffer, int size);
int Write(const void *buffer, int size);
// basically a wrapper for select(): returns the condition of the socket,
// blocking for not longer than timeout if it is specified (otherwise just
@@ -355,6 +358,12 @@ private:
// update local address after binding/connecting
wxSocketError UpdateLocalAddress();
// functions used to implement Read/Write()
int RecvStream(void *buffer, int size);
int RecvDgram(void *buffer, int size);
int SendStream(const void *buffer, int size);
int SendDgram(const void *buffer, int size);
// set in ctor and never changed except that it's reset to NULL when the
// socket is shut down