(defun create-client (port buffer) (let ((socket (usocket:socket-connect "127.0.0.1" port :protocol :datagram :element-type '(unsigned-byte 8)))) (unwind-protect (progn (format t "Sending data~%") (replace buffer #(1 2 3 4 5 6 7 8)) (format t "Receiving data~%") (usocket:socket-send socket buffer 8) (usocket:socket-receive socket buffer 8) (format t "~A~%" buffer)) (usocket:socket-close socket))))
[0]: https://docs.racket-lang.org/reference/udp.html
-----