aboutsummaryrefslogtreecommitdiff
path: root/src/tcpsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcpsocket.cpp')
-rw-r--r--src/tcpsocket.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/tcpsocket.cpp b/src/tcpsocket.cpp
index 399ec44..b9b215c 100644
--- a/src/tcpsocket.cpp
+++ b/src/tcpsocket.cpp
@@ -31,7 +31,7 @@
31 31
32namespace Bu { subExceptionDef( TcpSocketException ) } 32namespace Bu { subExceptionDef( TcpSocketException ) }
33 33
34Bu::TcpSocket::TcpSocket( int nTcpSocket ) : 34Bu::TcpSocket::TcpSocket( handle nTcpSocket ) :
35 nTcpSocket( nTcpSocket ), 35 nTcpSocket( nTcpSocket ),
36 bActive( true ), 36 bActive( true ),
37 bBlocking( true ) 37 bBlocking( true )
@@ -443,11 +443,24 @@ Bu::String Bu::TcpSocket::getAddress() const
443 return sAddress; 443 return sAddress;
444} 444}
445 445
446Bu::TcpSocket::operator int() const 446Bu::TcpSocket::operator Bu::TcpSocket::handle() const
447{ 447{
448 return nTcpSocket; 448 return nTcpSocket;
449} 449}
450 450
451Bu::TcpSocket::handle Bu::TcpSocket::getHandle() const
452{
453 return nTcpSocket;
454}
455
456Bu::TcpSocket::handle Bu::TcpSocket::takeHandle()
457{
458 handle nRet = nTcpSocket;
459 bActive = false;
460 nTcpSocket = 0;
461 return nRet;
462}
463
451Bu::size Bu::TcpSocket::getSize() const 464Bu::size Bu::TcpSocket::getSize() const
452{ 465{
453 throw UnsupportedException(); 466 throw UnsupportedException();