In English:
1. Viewer connects to FAHClient ok
2. Viewer disconnects from Client about 1/6000th of a second later
3. An in-flight message "Welcome to the Folding@home Client command server" is received from FAHClient
4. That's All Folks.
In technobabble network trace speak:
This is FAHV connecting...
13:41:18.085393 49780 → 36330 [SYN] Seq=0 Win=64240 Len=0 MSS=65495 WS=256 SACK_PERM=1
This is FAHC acknowledging the connection...
13:41:18.085424 36330 → 49780 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
13:41:18.085551 49780 → 36330 [ACK] Seq=1 Ack=1 Win=525568 Len=0
This is FAHV disconnecting...
13:41:18.085723 49780 → 36330 [FIN, ACK] Seq=1 Ack=1 Win=525568 Len=0
13:41:18.085737 36330 → 49780 [ACK] Seq=1 Ack=2 Win=525568 Len=0
FAHV didn't even wait for the welcome response...
13:41:18.188657 36330 → 49780 [PSH, ACK] Seq=1 Ack=2 Win=525568 Len=60 "Welcome to the Folding@home Client command server"
13:41:18.188869 49780 → 36330 [RST, ACK] Seq=2 Ack=61 Win=0 Len=0 RST=Connection Reset aka winsock error 10053
2 guesses as to what is wrong with the Viewer:
1. The receive timeout is wrong
2. It's a non-blocking socket being read when no data is available to read. On Windows recv() will return SOCKET_ERROR (-1) to flag a status code. You need to call WSAGetLastError() to get the status code - if it returns WSAEWOULDBLOCK (10035) then it just means no data to read yet and try again later. -1 from recv() is not always a fatal error. On Linux check errno for EWOULDBLOCK or EAGAIN (I just googled Linux - I'm not a know-it-all).
I just found the source code (Client.cpp):
setBlocking(false);
So it is a non-blocking socket.
Code: Select all
int count = read();
if (count <= 0) {
if (count < 0 || lastData + 20 < Time::now()) reconnect();
return false;
}
Windows 10 64-bit Intel i7 6700k.