               [gloss.io :as io]
               [gloss.core :as gloss]
               [clojure.edn :as edn]
+              [aleph.netty :as aleph-netty]
               [aleph.tcp :as tcp])
     (:import [java.nio ByteBuffer]))
 

          release-ch (chan (clojure.core.async/dropping-buffer 10000))
          daemon (:acking-daemon component)
          ip "0.0.0.0"
          port (+ 5000 (rand-int 45000))
          server (start-server (ch-handler net-ch) port)
          _ (app daemon net-ch inbound-ch release-ch)]
      (assoc component :server server :ip ip :port port :release-ch release-ch)))

  (stop [component]
    (taoensso.timbre/info "Stopping Aleph TCP Sockets")
    ; NEED TO STOP APP GO LOOP HERE
    (close! (:release-ch component))
    (assoc component :release-ch nil)))

(defn aleph-tcp-sockets [opts]
  (map->AlephTcpSockets {:opts opts}))

; not much need for these in aleph
(defmethod extensions/send-peer-site AlephTcpSockets
  [messenger]
  [(:ip messenger) (:port messenger)])

   {:port port}))

(defn app [daemon net-ch inbound-ch release-ch]
  (go-loop []
           (let [[msg-type payload] (<!! net-ch)]
             (try 
