problem with select
I've got a problem with my select function. every time i call it, it's returning '1', indicating that from a socket can be read.
here's a part of my code:
my Problem is, that i'm recv()'ing after the select() on the same socket (where isn't all the time data available) so my program blocks for the time, no data recieved.
struct timeval pTimeval;
pTimeval.tv_sec = 0;
pTimeval.tv_usec = 0;
iRet = select(Socket + 1, &fdRead, NULL, NULL, &pTimeval);
if (FD_ISSET(Socket, &fdRead))
iRet = recv(Socket, buffer, SIZE, 0);
plz help me.
what a miracle.... its working now. ^^
Cool. :) I was going to suggest you post more code, as there isn't anything obviously wrong with that snippet.