[IPython-dev] connecting ipythonqt to an existing kernel should not require specifying 4 ports

MinRK benjaminrk at gmail.com
Thu Sep 9 20:32:05 EDT 2010


On Thu, Sep 9, 2010 at 17:21, Evan Patterson <epatters at enthought.com> wrote:

> On Thu, Sep 9, 2010 at 3:58 PM, MinRK <benjaminrk at gmail.com> wrote:
> > Hello,
> > In order to connect a second ipythonqt frontend to an existing kernel, I
> > must specify by hand all 4 ports at the command-line.  This really
> shouldn't
> > be the case, especially since the default behavior is to have the ports
> > ordered sequentially.
>
> That may be the default behavior of your OS, but that's not the
> default behavior in general. Random port is selection is currently
> left entirely up to the OS (as it should be), and on some systems this
> means that you get ports that appear to be totally random.
>

Good point, that makes a two-stage connect even more important, since you
can't expect the relationship between the port numbers to be well behaved.


>
> Guaranteeing that the ports are in consecutive order requires ugly
> code (a while loop that keeps binding a port until you find one that
> has three consecutive ports that are also open). Frankly, I think that
> if you care what the ports are, you should just pass them when
> launching the kernel in the first place.
>

The problem is not that I care what the ports are, quite the opposite. I
don't want to care what the ports are, but the current state requires me to
track a new set of 4 every time. This is quite unpleasant for launching
multiple clients on a kernel, in addition to being unnecessary.

It should be very easy to connect additional clients to a running kernel,
and specifying every port by hand does not qualify.

$> ipythonqt -e
should successfully connect to a kernel started with:
$> ipythonqt

At the _very worst_, a single port (or file) should have to be specified to
connect to a kernel launched with defaults.

This can be done, as it was in Twisted code, via a file in IPYTHON_DIR, or
even better with a two-stage connect.

-MinRK


> Evan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20100909/2ab42db5/attachment.html>


More information about the IPython-dev mailing list