(use-modules (ice-9 format)) (import (rnrs bytevectors)) (import (rnrs bytevectors gnu)) (import (srfi 18)) (define server (socket PF_INET SOCK_DGRAM 0)) (bind server AF_INET (inet-pton AF_INET "127.0.0.1") 10000) (define buffer (make-u8vector 1024)) (let loop () (let* ((len (car (recvfrom! server buffer))) (message (utf8->string (bytevector-slice buffer 0 len)))) (format #t "Received string (~a): ~s~%" len message) (loop)))