aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
commitac517a2b7625e0aa0862679e961c6349f859ea3b (patch)
treee3e27a6b9bd5e2be6150088495c91fc91786ad9d /src/socket.h
parentf8d4301e9fa4f3709258505941e37fab2eadadc6 (diff)
parentbd865cee5f89116c1f054cd0e5c275e97c2d0a9b (diff)
downloadlibbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.gz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.bz2
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.xz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.zip
The reorg is being put in trunk, I think it's ready. Now we just get to find
out how many applications won't work anymore :)
Diffstat (limited to '')
-rw-r--r--src/socket.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/socket.h b/src/socket.h
new file mode 100644
index 0000000..c291549
--- /dev/null
+++ b/src/socket.h
@@ -0,0 +1,55 @@
1#ifndef BU_SOCKET_H
2#define BU_SOCKET_H
3
4#include <stdint.h>
5
6#include "stream.h"
7#include "fstring.h"
8
9namespace Bu
10{
11 /**
12 *
13 */
14 class Socket : public Stream
15 {
16 public:
17 Socket( int nSocket );
18 Socket( const FString &sAddr, int nPort, int nTimeout=30 );
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 read( void *pBuf, size_t nBytes, uint32_t nTimeout );
25 virtual size_t write( const void *pBuf, size_t nBytes );
26
27 virtual long tell();
28 virtual void seek( long offset );
29 virtual void setPos( long pos );
30 virtual void setPosEnd( long pos );
31 virtual bool isEOS();
32 virtual bool isOpen();
33
34 virtual void flush();
35
36 virtual bool canRead();
37 virtual bool canWrite();
38
39 virtual bool isReadable();
40 virtual bool isWritable();
41 virtual bool isSeekable();
42
43 virtual bool isBlocking();
44 virtual void setBlocking( bool bBlocking=true );
45
46 Bu::FString getAddress() const;
47
48 private:
49 int nSocket;
50 bool bActive;
51 FString sReadBuf;
52 };
53}
54
55#endif