]>
git.saurik.com Git - wxWidgets.git/blob - src/common/sckstrm.cpp
8dde4ba92e14fae4afd1506ccd19be7e022e0bb4
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSocket*Stream
4 // Author: Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "sckstrm.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
25 #include "wx/stream.h"
26 #include "wx/socket.h"
27 #include "wx/sckstrm.h"
29 // ---------------------------------------------------------------------------
30 // wxSocketOutputStream
31 // ---------------------------------------------------------------------------
33 wxSocketOutputStream::wxSocketOutputStream(wxSocketBase
& s
)
38 wxSocketOutputStream::~wxSocketOutputStream()
42 wxOutputStream
& wxSocketOutputStream::Write(const void *buffer
, size_t size
)
44 m_lastcount
= m_o_socket
->Write((const char *)buffer
, size
).LastCount();
48 size_t wxSocketOutputStream::OnSysWrite(const void *buffer
, size_t size
)
50 return m_o_socket
->Write((const char *)buffer
, size
).LastCount();
53 // ---------------------------------------------------------------------------
54 // wxSocketInputStream
55 // ---------------------------------------------------------------------------
57 wxSocketInputStream::wxSocketInputStream(wxSocketBase
& s
)
62 wxSocketInputStream::~wxSocketInputStream()
66 wxInputStream
& wxSocketInputStream::Read(void *buffer
, size_t size
)
68 m_lastcount
= m_i_socket
->Read((char *)buffer
, size
).LastCount();
72 size_t wxSocketInputStream::OnSysRead(void *buffer
, size_t size
)
74 return m_i_socket
->Read((char *)buffer
, size
).LastCount();
77 // ---------------------------------------------------------------------------
79 // ---------------------------------------------------------------------------
81 wxSocketStream::wxSocketStream(wxSocketBase
& s
)
82 : wxSocketInputStream(s
), wxSocketOutputStream(s
)
86 wxSocketStream::~wxSocketStream()