Skip Menu |

This queue is for tickets about the Finance-InteractiveBrokers-SWIG CPAN distribution.

Report information
The Basics
Id: 96110
Status: resolved
Priority: 0/
Queue: Finance-InteractiveBrokers-SWIG

People
Owner: INFIDEL [...] cpan.org
Requestors: gdg [...] zplane.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.12



Subject: setSelectTimeout() type conversion problem
Date: Sat, 31 May 2014 19:47:52 -0600
To: bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org
From: Glenn Golden <gdg [...] zplane.com>
Hi Jason, Regarding setSelectTimeout(): Couldn't find any "official" doc on it, but did come across your note dated Sat Sep 07 02:00:57 2013 in Bug #79926, which suggests that the synopsis is setSelectTimeout($x) where $x is in seconds. But calling it that way, regardless of the value of $x, seems to always yield this error: TypeError in method 'IBAPIClient_setSelectTimeout', argument 2 of type 'time_t' at [blah]/Finance/InteractiveBrokers/SWIG.pm line 229. Tried $x as 0, 1, 1.5, ... Took a look at the wrapper function in IBAPI_wrap.cxx, and the underlying type conversion routine SWIG_Perl_ConvertPtr(), but could not sort out what might be going on leading to that error. If you're not able to reproduce this, let me know how I can go about tracking it down further on my end. Perl version = 5.18.2. Thanks, Glenn
Did the unit tests in the distribution succeed? One of them checks for success of setSelectTimeout() (note also they require at least Finance::InteractiveBrokers::API 0.04): $ make test ... t/regression/003-fibswig-timeout.t ................... ok ... $ make test TEST_VERBOSE=1 ... t/regression/003-fibswig-timeout.t ................... 1..5 ok 1 - use Finance::InteractiveBrokers::SWIG; ok 2 - use Finance::InteractiveBrokers::SWIG::IBAPI; ok 3 - use TestEventHandler; # ok 4 - No exception thrown when using setSelectTimeout(42) # ok 5 - No exception thrown when using setSelectTimeout(-42) ok All tests successful. ...
Subject: Re: [rt.cpan.org #96110] setSelectTimeout() type conversion problem
Date: Sat, 31 May 2014 20:12:01 -0600
To: Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org>
From: Glenn Golden <gdg [...] zplane.com>
Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG@rt.cpan.org> [2014-05-31 22:04:26 -0400]: Show quoted text
> > Did the unit tests in the distribution succeed? >
Yes. See attached, full output of "make test TEST_VERBOSE=1". Show quoted text
> > One of them checks for success of setSelectTimeout() (note also they require > at least Finance::InteractiveBrokers::API 0.04): >
Have 0.04 installed

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #96110] setSelectTimeout() type conversion problem
Date: Sat, 31 May 2014 20:31:25 -0600
To: Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org>
From: Glenn Golden <gdg [...] zplane.com>
Fwiw, here's a minimal example that fails: ======================================================================= use strict; use warnings; use Finance::InteractiveBrokers::SWIG; use DummyEventHandler; my $handler = DummyEventHandler->new(); my $ibapi = Finance::InteractiveBrokers::SWIG->new ( handler => $handler, ); $ibapi->setSelectTimeout(42); =======================================================================
Subject: Re: [rt.cpan.org #96110] setSelectTimeout() type conversion problem
Date: Sat, 31 May 2014 20:47:05 -0600
To: Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org>
From: Glenn Golden <gdg [...] zplane.com>
Is it possible that this change in perl 5.14 might be implicated in the way that you interrogate the test results from eval() in your unit test func? http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod See first bullet under subsection "Exception Handling".
Needed a couple more typemaps, and unit tests weren't actually catching it (but not due to the 5.14.x Exception-handling changes). Your example program above now passes in 0.12, and the unit tests now work properly. I've attached 0.12 to this ticket, or alternatively it'll be up on CPAN within a few hours. Thanks! -J
Subject: Finance-InteractiveBrokers-SWIG-0.12.tar.gz

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #96110] setSelectTimeout() type conversion problem
Date: Sun, 1 Jun 2014 05:01:23 -0600
To: Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org>
From: Glenn Golden <gdg [...] zplane.com>
Jason McManus via RT <bug-Finance-InteractiveBrokers-SWIG@rt.cpan.org> [2014-06-01 00:13:10 -0400]: Show quoted text
> > Needed a couple more typemaps, and unit tests weren't actually catching > it (but not due to the 5.14.x Exception-handling changes). Your example > program above now passes in 0.12, and the unit tests now work properly. >
Confirmed. Hat-tip once again for taking care of this so quickly, Jason. Really appreciate your time. Guessing from the diffs between 0.11 and 0.12 that it was probably several hours work, including the prior ticket updates and the mechanics of pushing it out to CPAN. Very much appreciated. (Btw, that perl 5.14 change was just a guess on my part, I really had no clue if it was implicated or not, just looked like it "might be" so trying to save you some time in finding it in case it was.) Now that the setSelectTimeout() is working, I may have a few questions related to its use and interaction with processMessages(). Should I file those questions in a new ticket, or add them here, or just email you directly? Let me know your preference on that. Thanks again. Glenn
Well, I think the kind people who run rt.cpan.org would prefer we don't turn their bugtracker into a forum, so it's probably better to use email, and I'll try to get to it when I can.