On Jul 25, 2016 10:13 PM, "Sam Parkinson" <sam.parkins...@gmail.com> wrote: > > On Tue, Jul 26, 2016 at 9:56 AM, Abhijit Patel <abhisandhyasp...@gmail.com> wrote: >> >> I have just found python modules like socket[1] for low level networking interface and SocketServer[2] which simplifies the task of writing network servers. >> >> Could using these modules be a better option? >> >> [1] https://docs.python.org/2/library/socket.html >> [2] https://docs.python.org/2/library/socketserver.html >> e >> Thanks, >> Abhijit > > > Hi Abhijit, > > I think it would be good to just use TCP for our application protocol. Topology wise, I think we should do like AbiWord does. That is, we have a "leader" and everybody connects to the leader. The leader will then parse the messages, optionally process them, and rebroadcast them to all the other clients. > > Initially, the leader can probably be the person who 1st shared the activity. But if that person disconnects, or their computer looses power, we need to change the leader. > > We probably can't use the socket module directly, as we need Glib mainloop integration so we don't block the ui. GLib will take a file handle and give us a mainloop IOChannel via this api [1].
Please checkout zeromq :) > [1] http://lazka.github.io/pgi-docs/index.html#GLib-2.0/structs/IOChannel.html#GLib.IOChannel.unix_new > [2] https://developer.gnome.org/glib/stable/glib-IO-Channels.html#g-io-channel-unix-new > > _______________________________________________ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel >
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel