<div dir="ltr">Hi Burak,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 20, 2013 at 12:21 PM, Burak Nehbit <span dir="ltr"><<a href="mailto:burak@nehbit.net" target="_blank">burak@nehbit.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<br>
<br>
I was meaning to ask you all about the 'proper' way to use AMP in regards to two–way communication. The problem I am facing is quite simple, I am building a simple peer–to–peer network in which the user:<br>
<br>
a) When sent a handshake, returns a handshake,<br>
b) When asked for fingerprints of posts in the local, returns it, and then asks for the same thing,<br>
and finally, c) If any of the fingerprints do not match posts, request those posts with the fingerprint.<br>
<br>
The only non–symmetric step I have in my protocol is the last one.<br>
<br>
My question is, should I send my responses over the same AMP command as a response to the command requested, or should I just return an ACK (a boolean value of true, to confirm receipt) and then initiate a separate AMP request from local to the same remote?<br>

</blockquote><div><br></div><div>Keep in mind that AMP commands are always ack'ed without you needing to specify any kind of value, unless you set requiresResponse = False on the Command class.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



That would mean I would need to handle my open–connections pool by myself, to prevent posts from a non–initiated machine being accepted into the local machine, but I do need to implement that anyway due to the complexity of my business rules.</blockquote>

<div><br></div><div>I don't understand this part. It sounds like an authentication problem, no?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

At that point, it seems that I am (Am I?) just using AMP as a remote method header I don't strictly need, and I could just use LineReceiver—all my data is text—to do my bidding.<br></blockquote><div><br></div><div>It's usually correct that you can do things with LineReceiver, but it's also usually true that AMP is doing stuff for you ;)<br>

<br></div><div>Some more information about your system would be useful. Are posts append-only? Would it make sense to have a given serialization of them? If so, a hash chain would allow you to sync with just one hash value. A consensus protocol might help you figure out what that serialization is.<br>

</div><div><br></div><div>cheers<br></div><div>lvh<br></div></div></div></div></div>