开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Error 509 - exception caught while reading socket - no such file or directory


 

开云体育

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 ?

Cheers

Stew

On 15/07/15 22:11, souqmate@... [TWSAPI] wrote:
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 ?
S

---In TWSAPI@..., wrote :

errno =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.

On 15/07/15 19:17, souqmate@... [TWSAPI] wrote:
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:
    




-- 
Stewart Douglas
sdouglas@...

-- 
Stewart Douglas
sdouglas@...

Join [email protected] to automatically receive all group messages.