| 146 | } |
| 147 | |
| 148 | int Socket::Send( const void* _buf, int len ) |
| 149 | { |
| 150 | auto buf = (const char*)_buf; |
| 151 | assert( m_sock != -1 ); |
| 152 | auto start = buf; |
| 153 | while( len > 0 ) |
| 154 | { |
| 155 | auto ret = send( m_sock, buf, len, MSG_NOSIGNAL ); |
| 156 | if( ret == -1 ) return -1; |
| 157 | len -= ret; |
| 158 | buf += ret; |
| 159 | } |
| 160 | return int( buf - start ); |
| 161 | } |
| 162 | |
| 163 | int Socket::GetSendBufSize() |
| 164 | { |