QLocalSocket can be used to connect to the local socket on windows too:

http://doc.qt.nokia.com/4.7-snapshot/qlocalsocket.html

I used basic python socket library to reduce the overhead (no need to
import Qt), but unfortunately the implementation is Linux specific.

Using local sockets is preferred for scenarios like this, it's more
secure than using TCP sockets (and subsequently things like http).
QLocalSocket also plays nice with Qt event loop (no threads or messy
stuff like that).

On Wed, Oct 12, 2011 at 6:34 PM, Edward K. Ream <[email protected]> wrote:
> Windows does not have socket.AF_UNIX.
>
> Iirc, awhile back I tried to work around this in
> LProtoClient.connect.  I have no idea whether the initial efforts
> worked.  I suspect they did not, but who can tell now?
>
> Anyway, leoremote.py does not work on Windows, because
> LProtoClient.connect is failing. The reason for that failure is
> straightforward.  On Windows, lpc.connect is doing::
>
>    host = '172.16.0.0' # host is a local address.
>    port = 1
>    self.socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
>
> but the server is serving on the 'fname' argument to lpc.connect, and
> that's something totally different.  In fact, fname is a string
> containing a unique process id.
>
> So it appears that LProtoServer, and its helper,
> QtNetwork.QLocalServer, would need to serve on host 172.16.0.0 port 1.
>
> Or rather the reverse: somehow on Windows lpc.connect would need to
> communicate on the 'fname' channel.
>
> I'm stuck either way.  There is a comment in the <<imports>> section
> of lproto.py that it should eliminate the Qt (that is QtNetwork)
> dependencies.
>
> Perhaps now would be a good time??
>
> Your comments please.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups 
> "leo-editor" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/leo-editor?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to