aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-10 21:48:23 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-10 21:48:23 +0000
commit1fa3ca5f24c018126333ca2d6609730e1ae17386 (patch)
tree2877418e3b41c6fbd6505545cc01075899e5c7f8 /src/socket.h
parent070374dde0f53bff26078550997f7682e84412e5 (diff)
downloadlibbu++-1fa3ca5f24c018126333ca2d6609730e1ae17386.tar.gz
libbu++-1fa3ca5f24c018126333ca2d6609730e1ae17386.tar.bz2
libbu++-1fa3ca5f24c018126333ca2d6609730e1ae17386.tar.xz
libbu++-1fa3ca5f24c018126333ca2d6609730e1ae17386.zip
Added more comments, help, and socket actually reads and writes some, but it's
not done. I need to decide how I want to do the buffering...
Diffstat (limited to 'src/socket.h')
-rw-r--r--src/socket.h23
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
8namespace Bu 9namespace 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