anchor.diff:      ].
   
   
  -%% =================================================
  +%% =============================== ==================
   %%
   %% ------------------ errors ------------------------
   %% 
  
positive.code:     Opts = [{receive_handle, self()}, {module, ?MODULE} | Options], 
      try megaco_udp:open(Ref, Opts) of
  	{ok, Socket, ControlPid} ->
  	    {ok, State#{handle      => {socket, Socket}, 
  			control_pid => ControlPid}};
  	{error, {could_not_open_udp_port, eaddrinuse}} ->
  	    {skip, {client, eaddrinuse}};
  
negative.code:     Parent ! {blocked, self()},
      {ok, State}.
  
  client_await_nothing(State, Timeout) ->
      client_await_nothing(State, fun(_) -> ok end, Timeout).
  
  client_await_nothing(State, Fail, Timeout)
    when is_map(State) andalso is_function(Fail, 1) ->
      receive 
  	Any ->
  	    p("received unexpected event: ~p", [Any]),
              (catch Fail(Any)),
  	    {error, {unexpected_event, Any}}
      after Timeout ->
  	    {ok, State}
  