if(!inetbufs.dwBufferLength)
break;

ここがアヤシイ