Re: Gio FTP transfers stops after 25 seconds



The method isn't available because it's not introspectable. copy_async
requires multiple callbacks and user data argument, which is not
implemented yet in gobject-introspection. There's a bug report on Launchpad
about this:
https://bugs.launchpad.net/ubuntu/+source/gobject-introspection/+bug/1033196
and
it's been triaged by Martin Pitt himself so I'm quite sure that this will
be solved in the near future.

Meanwhile, I'm using the io_scheduler_push_job trick and it seems to work
fine except for FTP. I'm even starting to use io_scheduler_push_job to put
in background things that are not at all related to Gio (like
subprocess.Popen() calls). I'm still not sure that is the correct way of
doing things but until I find a better one, that will do.

Mathieu



On Mon, Jun 17, 2013 at 8:58 PM, אנטולי קרסנר <tombackton gmail com> wrote:

I don't have experience with Python, but still worth checking: Did you
check why the method isn't available in the bindings? Is it because of
how Python deals with concurrency, or just a "bug" which can be solved
by adding support for that method?

Sometimes I see GTK methods not having a C++ binding in gtkmm for random
reasons like developer time or lack of good ideas, so I'm making sure...
it may be much easier to use GTK than write your own implementation.

And even without an official binding, maybe you can link to the C
function from your Python code.

On ש', 2013-06-15 at 11:43 +0200, Mathieu Comandon wrote:
Hi,

On my project, I've been wanting to reproduce the behavior of
Gio.File.copy_async in a Python program (since this method isn't
available
in the bindings).

I managed to have something working quite well and it handles correctly
local files, HTTP, Samba but not FTP. The download starts normally but
stops after 25 seconds. The only other reference to a 25 seconds timeout
I
could find was the default timeout value of GDusProxy but I don't know
why
this would be related to FTP transfers.

The downloader code is available here:

http://bazaar.launchpad.net/~strycore/lutris/trunk/view/head:/lutris/downloader.py
As you can see, I'm making use of Gdk.threads and
Gio.io_scheduler_push_job, I have no idea if this is the correct way to
do
this kind of things but that's the best (almost) working solution I could
find.

There's also some test code for those who which to reproduce the issue
available here:

http://bazaar.launchpad.net/~strycore/lutris/trunk/view/head:/tests/benchmark_download.py

I would be so grateful if anyone had any idea of what's going on with FTP
transfers here.

Mathieu
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]