<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span>for some reason it blocks to wait while on listen...</span></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Wednesday, March 26, 2014 6:00 PM, Loïc Hoguin <essen@ninenines.eu> wrote:<br> </font> </div> <div class="y_msg_container">How about opening a socket on a random port?<br clear="none"><br clear="none">{ok, S} = gen_tcp:listen(0, [{active, false}]).<br clear="none"><div class="yqt9284968180" id="yqtfd30903"><br clear="none">On 03/26/2014 04:45 PM, Dror Mein
wrote:<br clear="none">> Hey all,<br clear="none">><br clear="none">> I want to eunit+meck test a simple telnet client which uses the guard<br clear="none">> is_port(Port).<br clear="none">> how can I pass something in meck:expect/4 that will pass the guard?<br clear="none">><br clear="none">> is it a record/reference that I can make up?<br clear="none">> can I use hd(erlang:ports()) -> #Port<0.0> without blowing up?<br clear="none">> Thanks</div><br clear="none">><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> erlang-questions mailing list<br clear="none">> <a shape="rect" ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br clear="none">> <a shape="rect" href="http://erlang.org/mailman/listinfo/erlang-questions"
target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br clear="none">><br clear="none"><br clear="none">-- <br clear="none">Loïc Hoguin<br clear="none"><a shape="rect" href="http://ninenines.eu/" target="_blank">http://ninenines.eu</a><div class="yqt9284968180" id="yqtfd72836"><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>