(in-package :usocket) (with-client-socket (socket stream "localhost" 61613) (format stream "CONNECT~%~%~C" #\Null) (force-output stream) ; Skip the CONNECTED 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) )