Class ::ftpd::Server

::ftpd::Server[i] create ... \
           [ -host (default "::1") ] \
           [ -listen listen ] \
           [ -port (default "21") ] \
           [ -rootdir:substdefault (default "[file normalize [ns_server pagedir]/]") ]

Defined in

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::ftpd::Infrastructure[i]
::nx::Class create ::ftpd::Server \
     -superclass ::ftpd::Infrastructure

Methods (to be applied on instances)

  • destroy (scripted, public)

     <instance of ftpd::Server[i]> destroy

    Testcases:
    No testcase defined.
    if {[info exists :listen]} {
        ns_connchan close ${:listen}
    }
    next
  • listen (scripted, public)

     <instance of ftpd::Server[i]> listen

    Testcases:
    No testcase defined.
    set dict [ns_connchan listen ${:host} ${:port} [list [self] listen_handler]]
    if {[dict exists $dict channel]} {
        set :listen [dict get $dict channel]
        :log notice "Ftpd listening on ftp://\[${:host}\]:${:port}"
    } else {
        :log warning "Ftpd can't listen on ftp://\[${:host}\]:${:port}"
    }
  • listen_handler (scripted, public)

     <instance of ftpd::Server[i]> listen_handler channel
    Parameters:
    channel (required)

    Testcases:
    No testcase defined.
    :log debug "listen_handler $channel"
    Session new -channel $channel -host ${:host} -rootdir ${:rootdir}
    return 1