anchor.diff:    when (Handle =/= undefined) ->
        megaco_tcp:close(Handle),
       {ok, State#server{handle = undefined}};
  -server_disconnect(#server{handle = Handle} = State) 
  +server_disconnect(#{handle := Handle} = State) 
     when (Handle =/= undefined) ->
        megaco_tcp:close(Handle),
  -    {ok, State#server{handle = undefined}}.
  +    {ok, State#{handle => undefined}}.
   
   server_stop_transport(#server{transport_ref = Ref} = State) 
     when (Ref =/= undefined) ->
  
positive.code:     Opts = [{port, Port}], 
      Self = self(),
      [
       #command{id   = 1,
  	      desc = "Command sequence init",
  	      cmd  = fun(State) -> 
  			     {ok, State#server{parent = Self}} 
  		     end},
  
       #command{id   = 2,
  	      desc = "Start transport",
  	      cmd  = fun(State) -> 
  			     server_start_transport(State) 
  		     end},
  
       #command{id   = 3,
  	      desc = "Listen",
  	      cmd  = fun(State) -> 
  			     server_listen(State, Opts) 
  		     end},
  
       #command{id   = 4,
  	      desc = "Notify listening",
  	      cmd  = fun(State) -> 
  			     server_notify_listening(State) 
  		     end},
  
       #command{id   = 5,
  	      desc = "Await initial message (ping)",
  	      cmd  = fun(State) -> 
  			     server_await_initial_message(State, "ping", 5000) 
  		     end},
  
       #command{id   = 6,
  	      desc = "Send reply (pong) to initial message",
  	      cmd  = fun(State) -> 
  			     server_send_message(State, "pong") 
  		     end},
  
       #command{id   = 7,
  	      desc = "Await nothing before sending a message (hejsan)",
  	      cmd  = fun(State) -> 
  			     server_await_nothing(State, 1000) 
  		     end},
  
       #command{id   = 8,
  	      desc = "Send message (hejsan)",
  	      cmd  = fun(State) -> 
  			     server_send_message(State, "hejsan") 
  		     end},
  
       #command{id   = 9,
  	      desc = "Await reply (hoppsan) to message",
  	      cmd  = fun(State) -> 
  			     server_await_message(State, "hoppsan", 1000) 
  		     end},
  
       #command{id   = 10,
  	      desc = "Await nothing before disconnecting",
  	      cmd  = fun(State) -> 
  			     server_await_nothing(State, 1000) 
  		     end},
  
       #command{id   = 11,
  	      desc = "Disconnect",
  	      cmd  = fun(State) -> 
  			     server_disconnect(State) 
  		     end},
  
       #command{id   = 12,
  	      desc = "Await nothing before stopping transport",
  	      cmd  = fun(State) -> 
  			     server_await_nothing(State, 1000) 
  		     end},
  
       #command{id   = 13,
  	      desc = "Stop",
  	      cmd  = fun(State) -> 
  			     server_stop_transport(State) 
  		     end}
  
      ].
  
  
negative.code:     Opts = [{port, ServerPort}, {host, ServerHost}], 
      Self = self(),
      [
       #{id   => 1,
         desc => "Command sequence init",
         cmd  => fun(State) -> 
  		       {ok, State#{parent => Self}} 
  	       end},
  
       #{id   => 2,
         desc => "Start transport",
         cmd  => fun(State) -> 
  		       client_start_transport(State) 
  	       end},
  
       #{id   => 3,
         desc => "Await continue",
         cmd  => fun(State) -> 
  		       client_await_continue_signal(State, 5000) 
  	       end},
  
       #{id   => 4,
         desc => "Connect",
         cmd  => fun(State) -> 
  		       client_connect(State, Opts) 
  	       end},
  
       #{id   => 5,
         desc => "Send initial message (ping)",
         cmd  => fun(State) -> 
  		       client_send_message(State, "ping") 
  	       end},
  
       #{id   => 6,
         desc => "Await reply (pong) to initial message",
         cmd  => fun(State) -> 
  		       client_await_message(State, "pong", 1000) 
  	       end},
  
       #{id   => 7,
         desc => "Await message (hejsan)",
         cmd  => fun(State) -> 
  		       client_await_message(State, "hejsan", 5000) 
  	       end},
  
       #{id   => 8,
         desc => "Send reply (hoppsan) to message",
         cmd  => fun(State) -> 
  		       client_send_message(State, "hoppsan") 
  	       end},
  
       #{id   => 9,
         desc => "Await nothing before disconnecting",
         cmd  => fun(State) -> 
  		       client_await_nothing(State, 1000) 
  	       end},
  
       #{id   => 10,
         desc => "Disconnect",
         cmd  => fun(State) -> 
  		       client_disconnect(State) 
  	       end},
  
       #{id   => 11,
         desc => "Await nothing before stopping transport",
         cmd  => fun(State) -> 
  		       client_await_nothing(State, 1000) 
  	       end},
  
       #{id   => 12,
         desc => "Stop transport",
         cmd  => fun(State) -> 
  		       client_stop_transport(State) 
  	       end}
      ].
  
  
  