From: Stelian Ionescu Date: Mon, 14 Oct 2013 15:10:46 +0000 (+0200) Subject: Add RECEIVE-FROM for raw sockets X-Git-Tag: v0.8.1~49 X-Git-Url: https://repo.or.cz/w/iolib.git/commitdiff_plain/0b88da7ce12e2d2ce3bca1122aaa05b884744048 Add RECEIVE-FROM for raw sockets Thanks to Christopher Laux --- diff --git a/src/sockets/socket-methods.lisp b/src/sockets/socket-methods.lisp index 95cb3e6..8096c61 100644 --- a/src/sockets/socket-methods.lisp +++ b/src/sockets/socket-methods.lisp @@ -567,6 +567,11 @@ (let ((nbytes (%receive-from (fd-of socket) ss size buffer start end flags))) (values buffer nbytes)))) +(defmethod receive-from ((socket raw-socket) &key buffer start end flags) + (with-sockaddr-storage-and-socklen (ss size) + (let ((nbytes (%receive-from (fd-of socket) ss size buffer start end flags))) + (values buffer nbytes)))) + (defmethod receive-from ((socket datagram-socket) &key buffer start end flags) (with-sockaddr-storage-and-socklen (ss size) (let ((nbytes (%receive-from (fd-of socket) ss size buffer start end flags)))