Socket::Poll does not need a callback

This commit is contained in:
Benjamin Sergeant
2019-04-18 16:42:44 -07:00
parent aea859af52
commit 03f762db86
3 changed files with 87 additions and 77 deletions

View File

@ -45,17 +45,14 @@ namespace ix
close();
}
void Socket::poll(const OnPollCallback& onPollCallback, int timeoutSecs)
PollResultType Socket::poll(int timeoutSecs)
{
if (_sockfd == -1)
{
if (onPollCallback) onPollCallback(PollResultType::Error);
return;
return PollResultType::Error;
}
PollResultType pollResult = isReadyToRead(1000 * timeoutSecs);
if (onPollCallback) onPollCallback(pollResult);
return isReadyToRead(1000 * timeoutSecs);
}
PollResultType Socket::select(bool readyToRead, int timeoutMs)