diff options
Diffstat (limited to 'src/socket.h')
-rw-r--r-- | src/socket.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/socket.h b/src/socket.h index 8ccde71..3d0125d 100644 --- a/src/socket.h +++ b/src/socket.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | 5 | ||
6 | #include "stream.h" | 6 | #include "stream.h" |
7 | #include "fstring.h" | ||
7 | 8 | ||
8 | namespace Bu | 9 | namespace Bu |
9 | { | 10 | { |
@@ -13,11 +14,29 @@ namespace Bu | |||
13 | class Socket : public Stream | 14 | class Socket : public Stream |
14 | { | 15 | { |
15 | public: | 16 | public: |
16 | Socket(); | 17 | Socket( int nSocket ); |
18 | Socket( const FString &sAddr, int nPort, int nTimeout=30 ); | ||
17 | virtual ~Socket(); | 19 | virtual ~Socket(); |
20 | |||
21 | virtual void close(); | ||
22 | virtual void read(); | ||
23 | virtual size_t read( void *pBuf, size_t nBytes ); | ||
24 | virtual size_t write( const void *pBuf, size_t nBytes ); | ||
18 | 25 | ||
19 | private: | 26 | virtual long tell(); |
27 | virtual void seek( long offset ); | ||
28 | virtual void setPos( long pos ); | ||
29 | virtual void setPosEnd( long pos ); | ||
30 | virtual bool isEOS(); | ||
31 | |||
32 | virtual bool canRead(); | ||
33 | virtual bool canWrite(); | ||
34 | virtual bool canSeek(); | ||
20 | 35 | ||
36 | private: | ||
37 | int nSocket; | ||
38 | bool bActive; | ||
39 | FString sReadBuf; | ||
21 | }; | 40 | }; |
22 | } | 41 | } |
23 | 42 | ||