|
@@ -342,6 +342,19 @@ bool SSLErrorCheck(__int64 result, const char* action)
|
|
|
|
|
|
bool SKlient::waitForNextMessage() const
|
|
|
{
|
|
|
+ fd_set set;
|
|
|
+ int rv = 0;
|
|
|
+ struct timeval timeout;
|
|
|
+ while (rv == 0 && sock)
|
|
|
+ {
|
|
|
+ FD_ZERO(&set);
|
|
|
+ FD_SET(sock, &set);
|
|
|
+ timeout.tv_sec = 10;
|
|
|
+ timeout.tv_usec = 0;
|
|
|
+ rv = select((int)sock + 1, &set, NULL, NULL, &timeout);
|
|
|
+ if (rv == -1) return 0;
|
|
|
+ }
|
|
|
+ if (!sock) return 0;
|
|
|
char c;
|
|
|
int l = (int)recv(sock, &c, 1, MSG_WAITALL | MSG_PEEK);
|
|
|
if (l <= 0)
|