summaryrefslogtreecommitdiff
path: root/src/tcpsocket.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/tcpsocket.h
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to 'src/tcpsocket.h')
-rw-r--r--src/tcpsocket.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/tcpsocket.h b/src/tcpsocket.h
index ce15172..dbaaa5e 100644
--- a/src/tcpsocket.h
+++ b/src/tcpsocket.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved. 2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 * 3 *
4 * This file is part of the libbu++ library and is released under the 4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
@@ -10,8 +10,9 @@
10 10
11#include <stdint.h> 11#include <stdint.h>
12 12
13#include "bu/config.h"
13#include "bu/stream.h" 14#include "bu/stream.h"
14#include "bu/fstring.h" 15#include "bu/string.h"
15#include "bu/exceptionbase.h" 16#include "bu/exceptionbase.h"
16 17
17namespace Bu 18namespace Bu
@@ -60,23 +61,23 @@ namespace Bu
60 { 61 {
61 public: 62 public:
62 TcpSocket( int nTcpSocket ); 63 TcpSocket( int nTcpSocket );
63 TcpSocket( const FString &sAddr, int nPort, int nTimeout=30, 64 TcpSocket( const String &sAddr, int nPort, int nTimeout=30,
64 bool bBlocking=true ); 65 bool bBlocking=true );
65 virtual ~TcpSocket(); 66 virtual ~TcpSocket();
66 67
67 virtual void close(); 68 virtual void close();
68 virtual size_t read( void *pBuf, size_t nBytes ); 69 virtual size read( void *pBuf, size nBytes );
69 virtual size_t read( void *pBuf, size_t nBytes, 70 virtual size read( void *pBuf, size nBytes,
70 uint32_t nSec, uint32_t nUSec=0 ); 71 uint32_t nSec, uint32_t nUSec=0 );
71 virtual size_t write( const void *pBuf, size_t nBytes ); 72 virtual size write( const void *pBuf, size nBytes );
72 virtual size_t write( const void *pBuf, size_t nBytes, 73 virtual size write( const void *pBuf, size nBytes,
73 uint32_t nSec, uint32_t nUSec=0 ); 74 uint32_t nSec, uint32_t nUSec=0 );
74 using Stream::write; 75 using Stream::write;
75 76
76 virtual long tell(); 77 virtual size tell();
77 virtual void seek( long offset ); 78 virtual void seek( size offset );
78 virtual void setPos( long pos ); 79 virtual void setPos( size pos );
79 virtual void setPosEnd( long pos ); 80 virtual void setPosEnd( size pos );
80 virtual bool isEos(); 81 virtual bool isEos();
81 virtual bool isOpen(); 82 virtual bool isOpen();
82 83
@@ -92,11 +93,15 @@ namespace Bu
92 virtual bool isBlocking(); 93 virtual bool isBlocking();
93 virtual void setBlocking( bool bBlocking=true ); 94 virtual void setBlocking( bool bBlocking=true );
94 95
95 virtual void setSize( long iSize ); 96 virtual void setSize( size iSize );
96 97
97 Bu::FString getAddress() const; 98 Bu::String getAddress() const;
98 operator int() const; 99 operator int() const;
99 100
101 virtual size getSize() const;
102 virtual size getBlockSize() const;
103 virtual Bu::String getLocation() const;
104
100 private: 105 private:
101 void setAddress(); 106 void setAddress();
102 107
@@ -107,8 +112,8 @@ namespace Bu
107#endif 112#endif
108 bool bActive; 113 bool bActive;
109 bool bBlocking; 114 bool bBlocking;
110 FString sReadBuf; 115 String sReadBuf;
111 FString sAddress; 116 String sAddress;
112 }; 117 };
113} 118}
114 119