anchor.diff:  	    Error
       end;
   
  -shell(Host) ->
  -    shell(Host, ?SSH_DEFAULT_PORT, []).
  +shell(Dest) ->
  +    case is_host(Dest, []) of
  +        true ->
  +            shell(Dest, ?SSH_DEFAULT_PORT, []);
  +        false ->
  +            %% Maybe socket
  +            shell_socket(Dest, [])
  +    end.
  +
   
   
   -spec shell(open_socket() | host(), client_options()) ->  _.
   
  -shell(Socket, Options) when is_port(Socket) ->
  +shell(Dest, Options) ->
  +    case is_host(Dest, Options) of
  +        true ->
  +            shell(Dest, ?SSH_DEFAULT_PORT, Options);
  +        false ->
  +            %% Maybe socket
  +            shell_socket(Dest, Options)
  +    end.
  +
  +shell_socket(Socket, Options) ->
       case connect(Socket, Options) of
           {ok,ConnectionRef} ->
               shell(ConnectionRef),
               close(ConnectionRef);
           Error ->
               Error
  -    end;
  -
  -shell(Host, Options) ->
  -    shell(Host, ?SSH_DEFAULT_PORT, Options).
  +    end.
  +    
   
   
   -spec shell(Host, Port, Options) -> _ when
  
positive.code:            ; (host(), inet:port_number(), client_options()) ->
                       {ok,connection_ref()} | {error,term()}.
  
  connect(Socket, UserOptions, NegotiationTimeout) when is_port(Socket),
                                                        is_list(UserOptions) ->
      case ssh_options:handle_options(client, UserOptions) of
  	{error, Error} ->
  	    {error, Error};
  
negative.code:       OpenTcpSocket :: open_socket(),
        Options :: client_options().
  
  connect(OpenTcpSocket, Options) when is_list(Options) ->
      connect(OpenTcpSocket, Options, infinity).
  
  
  