Hello again,

I am trying to use java built in HttpServer and it looks that the
handle method of HttpHandler interface does not get called at all (but
the server "works" - returns a blank page, which is expected as I do
not write anything in the handle method).

The following example is minimal implementation (cut down version of
the original code), what I do not understad is why the "handle" method
of HttpHandler interface does not get called at all. (I would expect
the server to print "exchange" object to the shell window on every
request handled.)

; imports omitted

(def port 8888)

(def handler (proxy [HttpHandler] []
               (handle [#^HttpExchange exchange]
                       (println exchange))))

(let [server (. HttpServer create (new InetSocketAddress port) 0)]
  (. server createContext "/" handler)
  (. server setExecutor (. Executors newCachedThreadPool))
  (. server start)
  (print "server listening on port: ")(println port)
  )

Is the proxy route wrong for this and I should use gen-class instead?

Kind regards,

Vlad

PS: The HttpHandler is an interface with one method called "handle".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to