From da7fd9f0feb27cd93930f464aca6ca9d1fecd295 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 13 Mar 2008 11:35:20 +0000 Subject: [PATCH] 1.0.15.24: SB-BSD-SOCKETS: add :DONTWAIT option to SOCKET-RECEIVE * For symmetry with SOCKET-SEND. --- contrib/sb-bsd-sockets/sockets.lisp | 22 ++++++++++++---------- version.lisp-expr | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/contrib/sb-bsd-sockets/sockets.lisp b/contrib/sb-bsd-sockets/sockets.lisp index e9fa645..549b471 100644 --- a/contrib/sb-bsd-sockets/sockets.lisp +++ b/contrib/sb-bsd-sockets/sockets.lisp @@ -156,25 +156,27 @@ values")) (defgeneric socket-receive (socket buffer length &key - oob peek waitall element-type) - (:documentation "Read LENGTH octets from SOCKET into BUFFER (or a freshly-consed buffer if -NIL), using recvfrom(2). If LENGTH is NIL, the length of BUFFER is -used, so at least one of these two arguments must be non-NIL. If -BUFFER is supplied, it had better be of an element type one octet wide. -Returns the buffer, its length, and the address of the peer -that sent it, as multiple values. On datagram sockets, sets MSG_TRUNC -so that the actual packet length is returned even if the buffer was too -small")) + oob peek waitall dontwait element-type) + (:documentation + "Read LENGTH octets from SOCKET into BUFFER (or a freshly-consed +buffer if NIL), using recvfrom(2). If LENGTH is NIL, the length of +BUFFER is used, so at least one of these two arguments must be +non-NIL. If BUFFER is supplied, it had better be of an element type +one octet wide. Returns the buffer, its length, and the address of the +peer that sent it, as multiple values. On datagram sockets, sets +MSG_TRUNC so that the actual packet length is returned even if the +buffer was too small.")) (defmethod socket-receive ((socket socket) buffer length &key - oob peek waitall + oob peek waitall dontwait (element-type 'character)) (with-sockaddr-for (socket sockaddr) (let ((flags (logior (if oob sockint::MSG-OOB 0) (if peek sockint::MSG-PEEK 0) (if waitall sockint::MSG-WAITALL 0) + (if dontwait sockint::MSG-DONTWAIT 0) #+linux sockint::MSG-NOSIGNAL ;don't send us SIGPIPE (if (eql (socket-type socket) :datagram) sockint::msg-TRUNC 0)))) diff --git a/version.lisp-expr b/version.lisp-expr index 9de3b23..cb693cd 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.15.19" +"1.0.15.24" -- 1.7.10.4