Hi Paul,<br><br>Thanks for your reply. I was actually passing the From parameter back and forth without knowing what it was exactly - I just assumed it was a naked Pid. And I was worried that apparently, gen_server:call accepted a reply from a process other than the process it sent the request to, opening up the possibility for the client to interpret any message received as a response. But now that you mention that From is actually a tuple containing a reference making the call unique, it all makes sense.<br>
<br>-- Jeroen Koops<br><br><div class="gmail_quote">On Tue, Jun 17, 2008 at 8:33 PM, Paul Fisher <<a href="mailto:pfisher@alertlogic.net">pfisher@alertlogic.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Tue, 2008-06-17 at 19:34 +0200, Jeroen Koops wrote:<br>
> I was wondering what the common way is to call one gen_server, have<br>
> this call forwarded to another gen_server, and have this other server<br>
> reply to the client. One way of doing this is by having the first<br>
> gen_server send a cast to the second gen_server, including the PID of<br>
> the client, and then respond with a noreply. The second gen_server<br>
> handles the cast by explicitly responding to the client using<br>
> gen_server:reply() - using the PID sent by the original gen_server, of<br>
> course. This seems to work, but it feels like a clumsy way to do it -<br>
> isn't there a better way?<br>
<br>
</div>That's the way to do it (although you'll need to pass along the whole<br>
>From parameter, which is really a 2-arity tuple with the calling<br>
processes pid and a make_ref/0 specific to that call.)<br>
<br>
<br>
--<br>
<font color="#888888">paul<br>
<br>
</font></blockquote></div><br>