diff options
Diffstat (limited to 'src/socket.cpp')
| -rw-r--r-- | src/socket.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index c4f914b..455b5c8 100644 --- a/src/socket.cpp +++ b/src/socket.cpp | |||
| @@ -118,6 +118,7 @@ void Bu::Socket::close() | |||
| 118 | //} | 118 | //} |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | /* | ||
| 121 | void Bu::Socket::read() | 122 | void Bu::Socket::read() |
| 122 | { | 123 | { |
| 123 | char buffer[RBS]; | 124 | char buffer[RBS]; |
| @@ -132,7 +133,6 @@ void Bu::Socket::read() | |||
| 132 | if( nbytes < 0 && errno != 0 && errno != EAGAIN ) | 133 | if( nbytes < 0 && errno != 0 && errno != EAGAIN ) |
| 133 | { | 134 | { |
| 134 | //printf("errno: %d, %s\n", errno, strerror( errno ) ); | 135 | //printf("errno: %d, %s\n", errno, strerror( errno ) ); |
| 135 | /* Read error. */ | ||
| 136 | //perror("readInput"); | 136 | //perror("readInput"); |
| 137 | throw ConnectionException( | 137 | throw ConnectionException( |
| 138 | excodeReadError, | 138 | excodeReadError, |
| @@ -146,15 +146,13 @@ void Bu::Socket::read() | |||
| 146 | break; | 146 | break; |
| 147 | nTotalRead += nbytes; | 147 | nTotalRead += nbytes; |
| 148 | sReadBuf.append( buffer, nbytes ); | 148 | sReadBuf.append( buffer, nbytes ); |
| 149 | /* Data read. */ | ||
| 150 | if( nbytes < RBS ) | 149 | if( nbytes < RBS ) |
| 151 | { | 150 | { |
| 152 | break; | 151 | break; |
| 153 | } | 152 | } |
| 154 | 153 | ||
| 155 | /* New test, if data is divisible by RBS bytes on some libs the | 154 | // New test, if data is divisible by RBS bytes on some libs the |
| 156 | * read could block, this keeps it from happening. | 155 | // read could block, this keeps it from happening. |
| 157 | */ | ||
| 158 | { | 156 | { |
| 159 | fd_set rfds; | 157 | fd_set rfds; |
| 160 | FD_ZERO(&rfds); | 158 | FD_ZERO(&rfds); |
| @@ -171,13 +169,7 @@ void Bu::Socket::read() | |||
| 171 | } | 169 | } |
| 172 | } | 170 | } |
| 173 | } | 171 | } |
| 174 | 172 | }*/ | |
| 175 | /* | ||
| 176 | if( pProtocol != NULL && nTotalRead > 0 ) | ||
| 177 | { | ||
| 178 | pProtocol->onNewData(); | ||
| 179 | }*/ | ||
| 180 | } | ||
| 181 | 173 | ||
| 182 | size_t Bu::Socket::read( void *pBuf, size_t nBytes ) | 174 | size_t Bu::Socket::read( void *pBuf, size_t nBytes ) |
| 183 | { | 175 | { |
