On Tue, Jul 26, 2016 at 9:56 AM, Abhijit Patel <abhisandhyasp.ap@gmail.com> wrote:<br>
<blockquote type="cite"><div>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.</div><div><br></div><div>Could using these modules be a better option? </div><div><br></div><div>[1] <a href="https://docs.python.org/2/library/socket.html">https://docs.python.org/2/library/socket.html</a></div><div>[2] <a href="https://docs.python.org/2/library/socketserver.html">https://docs.python.org/2/library/socketserver.html</a></div><div>e</div><div>Thanks,</div><div>Abhijit</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"></blockquote></blockquote><br>Hi Abhijit,
<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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].</div><div><br></div><div>[1] <a href="http://lazka.github.io/pgi-docs/index.html#GLib-2.0/structs/IOChannel.html#GLib.IOChannel.unix_new">http://lazka.github.io/pgi-docs/index.html#GLib-2.0/structs/IOChannel.html#GLib.IOChannel.unix_new</a></div><div>[2] <a href="https://developer.gnome.org/glib/stable/glib-IO-Channels.html#g-io-channel-unix-new">https://developer.gnome.org/glib/stable/glib-IO-Channels.html#g-io-channel-unix-new</a></div>