I found them in
/usr/include/asm-generic/errno-base.h on my box (Debian)
I'm using the codebase from Rudi
(). Having checked through
the code, I've realised that the code you are referring to is only
on one of the original IB branches, so I need to check why it was
removed, I don't think that is something I've done in my changes -
I've merged the latest 9.71 code into my local copy in a separate
branch).
I've never seen errno 2 coming back from a socket call, unless
possibly you're somehow using a bad fd, or the errno is getting
set by a system call in another thread.
If you're still managing to get responses from IB etc, then I
guess your change is ok - but it does feel fishy to me. Have you
made any other changes recently to you code ?
Thanks! I didn't even know these error numbers were universal for
unix!
What do you mean by "the version from twsapi"? Do you mean Jan
Boonen's TwsApiC++ (
?? But this one too has the same code I pasted,? see file
source/PosixClient/src/EPosixClientSocket.cpp.
And IB's API_9.71 has the same snippet as in API_9.68, so I doubt
using the latest API version will resolve issues.
What could cause these messy errors nb 2 ?
#define ENOENT?????????? 2????? /* No such file or directory
*/
Not sure why this error would be set, I don't see the code
you've
referenced below in my EPosixClientSocket.cpp - I'm using
the
version from twsapi, which is probably newer than your code.
Spot on! Or almost. Here's the error handler from EposixClientSocket.cpp:
bool EPosixClientSocket::handleSocketError()
{
// no error
if( errno == 0)
return true;
// Socket is already connected
if( errno == EISCONN) {
return true;
}
if( errno == EWOULDBLOCK)
return false;
if( errno == ECONNREFUSED) {
getWrapper()->error( NO_VALID_ID, CONNECT_FAIL.code(), CONNECT_FAIL.msg());
}
else {
getWrapper()->error( NO_VALID_ID, SOCKET_EXCEPTION.code(),
SOCKET_EXCEPTION.msg() + strerror(errno));
}
// reset errno
errno = 0;
eDisconnect();
return false;
}
Now the variables are EISCONN=106, EWOULDBLOCK=11, ECONNREFUSED=111;
I have errno=2, which makes me jump to the end and call eDisconnect().
Question: what's errno=2 and why do I get it after 1.5 or even 3 years ? Has IB introduced it overnight? (Yet this socket communication depends only on TWS and API, i.e. independent of IB's servers).
I can't believe I'm the only person affected. Thanks for your input!
SouqMate.
---In TWSAPI@..., wrote :
Check to see if your socket read() is returning EWOULDBLOCK error. This may be terminating your connection prematurely.
------------------------------------
Posted by: souqmate@...
------------------------------------
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
(Yahoo! ID required)
<*> To change settings via email:
TWSAPI-digest@...TWSAPI-fullfeatured@...
<*> To unsubscribe from this group, send an email to:
TWSAPI-unsubscribe@...
<*> Your use of Yahoo Groups is subject to: