<div dir="ltr">This <a href="https://github.com/brigadier/tara/blob/master/src/tara_worker.erl">https://github.com/brigadier/tara/blob/master/src/tara_worker.erl</a> client concurrently sends and receives data. The protocol is supposed to be standard request -> reply, but replies are send asynchronously (though with little to no delay) with the IDs of the request. It uses gen_server with async handle_call which returns {noreply, Reason}<div>If I misunderstood what you mean by 'concurrently', then might be you just need a pool of such clients.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-17 1:18 GMT+03:00 Thomas Elsgaard <span dir="ltr"><<a href="mailto:thomas.elsgaard@gmail.com" target="_blank">thomas.elsgaard@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>I am looking into building an client application which connects to an existing server via an TCP socket. When the application has established the socket it must keep it open, and  receive and send requests (concurrently) around 2000 Req/s. </div><div><br></div><div><div>What is the best design for such an application? Like:</div><div><br></div><div>- active or passive socket ?</div><div>- gen_server ?</div><div>- how many processes ?</div><div>- supervison tree ?</div><br class="m_7510830938807613230inbox-inbox-Apple-interchange-newline"></div><div>I have found examples of server and clients, but not an client which concurrently sends and receives data on the socket, does there exist anything similar applications i can look at ?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Thomas</div><div><br></div><div><br></div><div><br></div><div> </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div></font></span></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>