@@ -57,9 +57,8 @@ class fnTcpClientSocketHandle
5757
5858fnTcpClient::fnTcpClient (int fd)
5959{
60- _fd = fd;
6160 _connected = true ;
62- _clientSocketHandle.reset (new fnTcpClientSocketHandle (_fd ));
61+ _clientSocketHandle.reset (new fnTcpClientSocketHandle (fd ));
6362 _rxBuffer.clear ();
6463}
6564
@@ -432,23 +431,24 @@ void fnTcpClient::updateFIFO()
432431
433432#if defined(_WIN32)
434433 unsigned long count;
435- int res = ioctlsocket (_fd , FIONREAD, &count);
434+ int res = ioctlsocket (fd () , FIONREAD, &count);
436435 res = res != 0 ? -1 : count;
437436#else
438437 int count;
439- int res = ioctl (_fd , FIONREAD, &count);
438+ int res = ioctl (fd () , FIONREAD, &count);
440439 res = res < 0 ? -1 : count;
441440#endif
442441
443442 if (res > 0 )
444443 {
445444 ssize_t result;
445+ unsigned count;
446446
447447 for (count = res; count; count -= result)
448448 {
449449 size_t old_len = _rxBuffer.size ();
450450 _rxBuffer.resize (old_len + count);
451- result = recv (_fd , &_rxBuffer[old_len], count, 0 );
451+ result = recv (fd () , &_rxBuffer[old_len], count, 0 );
452452 if (result < 0 )
453453 result = 0 ;
454454 _rxBuffer.resize (old_len + result);
@@ -484,7 +484,7 @@ void fnTcpClient::flush()
484484 res = recv (fd (), (char *)buf, toRead, MSG_DONTWAIT);
485485 if (res < 0 )
486486 {
487- Debug_printf (" fail on fd %d, errno: %d, \" %s\"\r\n " ,
487+ Debug_printf (" fail on fd %d, errno: %d, \" %s\"\r\n " ,
488488 fd (), compat_getsockerr (), compat_sockstrerror (compat_getsockerr ()));
489489 stop ();
490490 break ;
0 commit comments