1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSocket*Stream
4 // Author: Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __SCK_STREAM_H__
12 #define __SCK_STREAM_H__
14 #include "wx/stream.h"
16 #if wxUSE_SOCKETS && wxUSE_STREAMS
18 #include "wx/socket.h"
20 class WXDLLIMPEXP_NET wxSocketOutputStream
: public wxOutputStream
23 wxSocketOutputStream(wxSocketBase
& s
);
24 virtual ~wxSocketOutputStream();
27 wxSocketBase
*m_o_socket
;
29 size_t OnSysWrite(const void *buffer
, size_t bufsize
);
31 // socket streams are both un-seekable and size-less streams:
32 wxFileOffset
OnSysTell() const
33 { return wxInvalidOffset
; }
34 wxFileOffset
OnSysSeek(wxFileOffset
WXUNUSED(pos
), wxSeekMode
WXUNUSED(mode
))
35 { return wxInvalidOffset
; }
37 wxDECLARE_NO_COPY_CLASS(wxSocketOutputStream
);
40 class WXDLLIMPEXP_NET wxSocketInputStream
: public wxInputStream
43 wxSocketInputStream(wxSocketBase
& s
);
44 virtual ~wxSocketInputStream();
47 wxSocketBase
*m_i_socket
;
49 size_t OnSysRead(void *buffer
, size_t bufsize
);
51 // socket streams are both un-seekable and size-less streams:
53 wxFileOffset
OnSysTell() const
54 { return wxInvalidOffset
; }
55 wxFileOffset
OnSysSeek(wxFileOffset
WXUNUSED(pos
), wxSeekMode
WXUNUSED(mode
))
56 { return wxInvalidOffset
; }
58 wxDECLARE_NO_COPY_CLASS(wxSocketInputStream
);
61 class WXDLLIMPEXP_NET wxSocketStream
: public wxSocketInputStream
,
62 public wxSocketOutputStream
65 wxSocketStream(wxSocketBase
& s
);
66 virtual ~wxSocketStream();
68 wxDECLARE_NO_COPY_CLASS(wxSocketStream
);
72 // wxUSE_SOCKETS && wxUSE_STREAMS