[erlang-questions] how does an erlang Socket/Port look from inside?

Loïc Hoguin <>
Wed Mar 26 17:00:55 CET 2014


How about opening a socket on a random port?

{ok, S} = gen_tcp:listen(0, [{active, false}]).

On 03/26/2014 04:45 PM, Dror Mein wrote:
> Hey all,
>
> I want to eunit+meck test a simple telnet client which uses the guard
> is_port(Port).
> how can I pass something in meck:expect/4 that will pass the guard?
>
> is it a record/reference that I can make up?
> can I use hd(erlang:ports()) -> #Port<0.0> without blowing up?
> Thanks
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list