1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSocket*Stream
4 // Author: Guilhem Lavaux
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __SCK_STREAM_H__
11 #define __SCK_STREAM_H__
13 #include "wx/stream.h"
15 #if wxUSE_SOCKETS && wxUSE_STREAMS
17 #include "wx/socket.h"
19 class WXDLLIMPEXP_NET wxSocketOutputStream
: public wxOutputStream
22 wxSocketOutputStream(wxSocketBase
& s
);
23 virtual ~wxSocketOutputStream();
26 wxSocketBase
*m_o_socket
;
28 size_t OnSysWrite(const void *buffer
, size_t bufsize
);
30 // socket streams are both un-seekable and size-less streams:
31 wxFileOffset
OnSysTell() const
32 { return wxInvalidOffset
; }
33 wxFileOffset
OnSysSeek(wxFileOffset
WXUNUSED(pos
), wxSeekMode
WXUNUSED(mode
))
34 { return wxInvalidOffset
; }
36 wxDECLARE_NO_COPY_CLASS(wxSocketOutputStream
);
39 class WXDLLIMPEXP_NET wxSocketInputStream
: public wxInputStream
42 wxSocketInputStream(wxSocketBase
& s
);
43 virtual ~wxSocketInputStream();
46 wxSocketBase
*m_i_socket
;
48 size_t OnSysRead(void *buffer
, size_t bufsize
);
50 // socket streams are both un-seekable and size-less streams:
52 wxFileOffset
OnSysTell() const
53 { return wxInvalidOffset
; }
54 wxFileOffset
OnSysSeek(wxFileOffset
WXUNUSED(pos
), wxSeekMode
WXUNUSED(mode
))
55 { return wxInvalidOffset
; }
57 wxDECLARE_NO_COPY_CLASS(wxSocketInputStream
);
60 class WXDLLIMPEXP_NET wxSocketStream
: public wxSocketInputStream
,
61 public wxSocketOutputStream
64 wxSocketStream(wxSocketBase
& s
);
65 virtual ~wxSocketStream();
67 wxDECLARE_NO_COPY_CLASS(wxSocketStream
);
71 // wxUSE_SOCKETS && wxUSE_STREAMS