on NON LINUX platform with UDP socket I think we should check if result>0 before doing recvfrom otherwise calling the function with result=0 can have unpredictable behavior and give me error
int SocketImpl::available()
{
int result = 0;
ioctl(FIONREAD, result);
#if (POCO_OS != POCO_OS_LINUX)
if (type() == SOCKET_TYPE_DATAGRAM)
{
std::vector<char> buf(result);
result = recvfrom(sockfd(), &buf[0], result, MSG_PEEK, NULL, NULL);
}
#endif
return result;
}
on NON LINUX platform with UDP socket I think we should check if result>0 before doing recvfrom otherwise calling the function with result=0 can have unpredictable behavior and give me error