add listen port option in file_server
throw error when file retrieval fails
replace connect callback with waitconnected