[Qgis-developer] Socket server freezes on Python plugin

G. Allegri giohappy at gmail.com
Tue Jun 19 03:29:47 PDT 2012


I've tried it.
I seems it depends on QGis not giving the plugin thread the option to serve
while IDLE waiting for user interaction.
The plugin server unfreezes even if you simply move the mouse over QGis
(wihtout doing any action on it).
It must be investigated...

giovanni

2012/6/19 Víctor González <victorzinho at gmail.com>

> Hi,
>
> I'm trying to create a plugin that opens a socket server in a separate
> thread and handles requests. I create the server using
> SocketServer.TCPServer and threading.Thread in the initGui method and the
> plugin starts correctly, but if I try to get a response from a client, the
> server freezes and does not respond.
>
> The strange thing is that I have added a toolbar button that opens and
> closes a file and, if I click that button, the server unfreezes and I get
> the response as expected. However, if I create the socket server with the
> same exact code as an standalone program, it works as expected without
> freezing.
>
> I have looked into the PyQgis cookbook [1] and the contributed plugins [2]
> searching for an example or solution but I couldn't find anything. Does
> anyone know what may be wrong? Any hint will be greatly appreciated. I
> attach the Qgis plugin as well as the standalone server and client.
>
> Thanks in advance,
> Víctor.
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120619/4190740b/attachment-0001.html>


More information about the Qgis-developer mailing list