aboutsummaryrefslogtreecommitdiff
path: root/src/tcpsocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcpsocket.h')
-rw-r--r--src/tcpsocket.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/tcpsocket.h b/src/tcpsocket.h
index dbaaa5e..52218bd 100644
--- a/src/tcpsocket.h
+++ b/src/tcpsocket.h
@@ -60,7 +60,13 @@ namespace Bu
60 class TcpSocket : public Stream 60 class TcpSocket : public Stream
61 { 61 {
62 public: 62 public:
63 TcpSocket( int nTcpSocket ); 63#ifdef WIN32
64 typedef unsigned int handle;
65#else
66 typedef int handle;
67#endif
68
69 TcpSocket( handle nTcpSocket );
64 TcpSocket( const String &sAddr, int nPort, int nTimeout=30, 70 TcpSocket( const String &sAddr, int nPort, int nTimeout=30,
65 bool bBlocking=true ); 71 bool bBlocking=true );
66 virtual ~TcpSocket(); 72 virtual ~TcpSocket();
@@ -96,7 +102,10 @@ namespace Bu
96 virtual void setSize( size iSize ); 102 virtual void setSize( size iSize );
97 103
98 Bu::String getAddress() const; 104 Bu::String getAddress() const;
99 operator int() const; 105 operator handle() const;
106
107 handle getHandle() const;
108 handle takeHandle();
100 109
101 virtual size getSize() const; 110 virtual size getSize() const;
102 virtual size getBlockSize() const; 111 virtual size getBlockSize() const;
@@ -105,11 +114,8 @@ namespace Bu
105 private: 114 private:
106 void setAddress(); 115 void setAddress();
107 116
108#ifdef WIN32 117 handle nTcpSocket;
109 unsigned int nTcpSocket; 118
110#else
111 int nTcpSocket;
112#endif
113 bool bActive; 119 bool bActive;
114 bool bBlocking; 120 bool bBlocking;
115 String sReadBuf; 121 String sReadBuf;