I want to get size of remaining data on tcp socket.
On linux I can do this:
#include <sys/ioctl.h>
int count;
ioctl(sockfd, FIONREAD, &count);
But this does not work with mingw, is there any alternative solution that works in mingw?
CodePudding user response:
I found the solution:
#include <winsock2.h>
unsigned long count;
ioctlsocket(sockfd, FIONREAD, &count);
