(in-package :socket) (let ((stream (make-socket :remote-host "localhost" :remote-port 61613))) (format stream "CONNECT~%~%~C" #\null) (force-output stream) ; Skip the CONNECT frame (loop for line = (read-line stream) until (string= line #\null)) (format stream "SUBSCRIBE~%destination:SampleQueue~%ack:auto~%~%~C" #\null) (force-output stream) ; Seek to the body of the MESSAGE frame (loop for line = (read-line stream) until (string= line "")) (print (read-line stream)) (format stream "DISCONNECT~%~%~C" #\null) )