 
 (defn wrote-cookie
   [clnt-> success]
+  (log/info "Wrote cookie packet to Client")
   (is (and success
            (not (keyword? success))))
   (if (not= success ::timeout)
     (do
-      (println "Server Cookie sent to client. Waiting for Initiate packet in response")
+      (log/info "Server Cookie sent to client. Waiting for Initiate packet in response")
       (strm/try-take! clnt-> ::drained 500 ::timeout))))
 
 (defn vouch->server
-  [->server vouch]
+  [mem-pool ->server vouch]
   ;; I don't have any real failure indication available
   ;; if something goes wrong with/on the server trying
   ;; to cope with this incoming vouch.
   ;; I almost need an error stream for dealing with exceptions.
-  (println "Got Initiate packet from client: "
-           vouch
-           " for forwarding along to "
-           ->server)
+  (log/info "Got Initiate packet from client: "
+            vouch
+            " for forwarding along to "
+            ->server)
   (is (not (keyword? vouch)))
   ;; There's something inside out going on.
   ;; We just forwarded the from the server to the

  ;; back to the Server.
  (if-not (or (= vouch ::drained)
              (= vouch ::timeout))
    (strm/try-put! (:chan ->server)
                   {:message vouch
                    :host "tester-client"
                    :port 65536}
                   500
                   ::timeout)
    (throw (ex-info "Retrieving Vouch from client failed"
                    {:failure vouch}))))



(defn retrieve-hello
  "This is really a server-side method"
  [mem-pool client-chan hello]
  (log/info "Pulled HELLO from client")
  (let [n (.readableBytes hello)]
    (println "Have" n "bytes to write to " client-chan)
    (if (= 224 n)
      (let [copy (.directBuffer mem-pool n)]
        (.readBytes hello copy)
        (.release hello)
        (strm/try-put! (:chan client-chan)
                       {:message copy
                        :host "test-client"
                        :port 65536}
                       500
                       ::timed-out))
      (throw (RuntimeException. "Bad Hello")))))

(defn wrote-hello
  [client-chan success]
  (log/info "Wrote HELLO to server")
  (is success "Failed to write hello to server")
  (is (not= success ::timed-out "Timed out waiting for server to read HELLO"))
  ;; This is timing out both here and in the server side.
