riwu
2015-01-18 02:50:21
Recently i have been having problem loading RS (in both browser and SMART), requiring multiple tries to load successfully. So i'm trying to setup a loop in SMART so that it auto retry for me when failed to spawn.
After some debugging, i confirmed that it's stuck in https://github.com/BenLand100/SMART/blob/6f5468c817d255584d3f6cf6823a4a1fe5494888/src/SmartRemote.cpp#L131
So i split the code from line130 onwards into
However, the values returned for both failed attempts and successful attempts appear to be the same.
sel is always 1, *buf is always 'I', len is always 1, only s varies from ~1150 to 1250.
So how could i predetermine if it's going to fail or pass so that if it's going to fail i wouldn't go into recv() and get stuck inside?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121%28v=vs.85%29.aspx
Changing the flags argument didn't help too.
After some debugging, i confirmed that it's stuck in https://github.com/BenLand100/SMART/blob/6f5468c817d255584d3f6cf6823a4a1fe5494888/src/SmartRemote.cpp#L131
So i split the code from line130 onwards into
int sel = select(client->socket+1, &rfds, &rfds, NULL, &tv);
if (sel) {
debug << sel << endl;
SOCKET s = client->socket;
char* buf = (char*)&funid;
int len = sizeof(char);
debug << "s: " << s << " buf: " << *buf << " len: " << len << endl;
int intRecv = recv(s, buf, len, 0);
However, the values returned for both failed attempts and successful attempts appear to be the same.
sel is always 1, *buf is always 'I', len is always 1, only s varies from ~1150 to 1250.
So how could i predetermine if it's going to fail or pass so that if it's going to fail i wouldn't go into recv() and get stuck inside?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121%28v=vs.85%29.aspx
Changing the flags argument didn't help too.