   that."
   (go
     (loop []
-      (log "MSMQ: Checking to see websocket is connected.")
-      ;; the following call forks a thread for the timeout, and immediately returns...
-      ;; so not really doing what it implies.
-      (let [new-aws (ensure-websocket-connected! 0 aws)]
-        (log "MSMQ: Websocket is connected!  Wait for message on app send channel.")
-        (log "MSMQ: new-aws >> " (type new-aws) " <<")
-        (log "MSMQ: app-send-chan: >> " (:app-send-chan new-aws) " << ===================   NIL  !!!!!!!!!")
-        (let [msg (<! (:app-send-chan new-aws))]
-          (log "MSMQ: Got message on application send channel: >> " msg " <<")
-          (log "MSMQ: Move onto websocket only send channel.")
-          (>! (:ws-only-send-chan new-aws) msg)))
+      (let [msg (<! (:app-send-chan aws))]
+        ;; (log "MSMQ: Got message on application send channel: >> " msg " <<")
+        ;; (log "MSMQ: Move onto websocket only send channel.")
+        (>! (:ws-only-send-chan aws) msg))
       (recur)))
   aws)
+
+;; --------- REPL Testing ----------
+(def url "ws://localhost:7890")
+
+;; main test:
+
+(def ws1 (async-websocket url))
+
+(defn get-on-msg [aws]
+  "get the on-message function for a websocket."
+  (aget (:websocket aws) "onmessage"))
+
+;; (go (>! ws1 "Hello"))
+;; (go (.log js/console "Answer" (<! ws1)))
 
 ;; -------- Helpers ----------
 

;; This is why we have to break up the send channel, so the app can
;; have a reliably there channel to work with.

(declare ws-state log new-websocket! monitor-send-msg-queue!)

(defrecord AsyncWebsocket [ws-url app-send-chan app-recv-chan ws-only-send-chan websocket]
  impl/ReadPort


(enable-console-print!)

