]>
git.saurik.com Git - wxWidgets.git/blob - src/common/sckstrm.cpp
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"
27 #include "wx/stream.h"
28 #include "wx/socket.h"
29 #include "wx/sckstrm.h"
31 // ---------------------------------------------------------------------------
32 // wxSocketOutputStream
33 // ---------------------------------------------------------------------------
35 wxSocketOutputStream::wxSocketOutputStream(wxSocketBase
& s
)
40 wxSocketOutputStream::~wxSocketOutputStream()
44 wxOutputStream
& wxSocketOutputStream::Write(const void *buffer
, size_t size
)
46 m_lastcount
= m_o_socket
->Write((const char *)buffer
, size
).LastCount();
50 size_t wxSocketOutputStream::OnSysWrite(const void *buffer
, size_t size
)
52 return m_o_socket
->Write((const char *)buffer
, size
).LastCount();
55 // ---------------------------------------------------------------------------
56 // wxSocketInputStream
57 // ---------------------------------------------------------------------------
59 wxSocketInputStream::wxSocketInputStream(wxSocketBase
& s
)
64 wxSocketInputStream::~wxSocketInputStream()
68 wxInputStream
& wxSocketInputStream::Read(void *buffer
, size_t size
)
70 m_lastcount
= m_i_socket
->Read((char *)buffer
, size
).LastCount();
74 size_t wxSocketInputStream::OnSysRead(void *buffer
, size_t size
)
76 return m_i_socket
->Read((char *)buffer
, size
).LastCount();
79 // ---------------------------------------------------------------------------
81 // ---------------------------------------------------------------------------
83 wxSocketStream::wxSocketStream(wxSocketBase
& s
)
84 : wxSocketInputStream(s
), wxSocketOutputStream(s
)
88 wxSocketStream::~wxSocketStream()