Hi there,

Attached is a patch for cl-zmq which updates and adds socket option
constants like router, dealer, linger. Some workarounds for namespace issues
had to be made, e.g. zevents, ztype, zfd instead of the preferred events,
type, fd. I chose that route because in particular 'type' messes with the
CFFI library.

I would have used a github fork request, but the common lisp bindings are
hosted on repo.or.cz. I did fork the repository as
https://github.com/lhope/cl-zmq which contains this commit.

This is my first formal commit to an open source project. I followed your
documentation, and I think everything is in order. I have a small bugfix
patch to come, too, as well as a zguide contribution. The zguide
contribution depends on this fix and the forthcoming one - due to the lack
of correct 'linger' handling in the current library.

Peace,

-Luke
-- 
---------------------------------------------------
Dr Lucas Hope - lucas.r.hope@skype
Machine Learning and Software Engineering Consultant
Melbourne, Australia
From 269fc5a8230be8ac17f476e37f6a9ce79a26ea13 Mon Sep 17 00:00:00 2001
From: Luke Hope <[email protected]>
Date: Sat, 4 Jun 2011 09:20:05 +1000
Subject: [PATCH] Updates and adds socket option constants like router, dealer, linger. Some workarounds for namespace issues had to be made, e.g. zevents, ztype, zfd instead of the preferred events, type, fd.

Signed-off-by: Luke Hope <[email protected]>
---
 package.lisp |   10 ++++++++++
 zeromq.lisp  |   25 ++++++++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/package.lisp b/package.lisp
index 3d9d4b5..f653556 100644
--- a/package.lisp
+++ b/package.lisp
@@ -54,6 +54,16 @@
    #:vsm
    #:xrep
    #:xreq
+   #:dealer
+   #:router
+   #:zfd
+   #:zevents
+   #:ztype
+   #:linger
+   #:reconnect-ivl
+   #:backlog
+   #:recovery-ivl-msec
+   #:reconnect-ivl-max
 
    #:events
 
diff --git a/zeromq.lisp b/zeromq.lisp
index 463f076..1a0af98 100644
--- a/zeromq.lisp
+++ b/zeromq.lisp
@@ -96,18 +96,22 @@
 ;;  0MQ socket definition.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+;; socket types.
 (defconstant pair 0)
 (defconstant pub 1)
 (defconstant sub 2)
 (defconstant req 3)
 (defconstant rep 4)
-(defconstant xreq 5)
-(defconstant xrep 6)
+(defconstant dealer 5)
+(defconstant router 6)
 (defconstant pull 7)
 (defconstant push 8)
-(defconstant upstream pull)
-(defconstant downstream push)
+(defconstant xreq dealer)     ; old alias
+(defconstant xrep router)     ; old alias
+(defconstant upstream pull)   ; old alias
+(defconstant downstream push) ; old alias
 
+;; socket options
 (defconstant hwm 1)
 (defconstant swap 3)
 (defconstant affinity 4)
@@ -120,7 +124,18 @@
 (defconstant sndbuf 11)
 (defconstant rcvbuf 12)
 (defconstant rcvmore 13)
-
+;; LRH2011-06-04: Can't define constants fd, type and events as
+;; they conflict with CFFI and/or other code here.
+(defconstant zfd 14)
+(defconstant zevents 15)
+(defconstant ztype 16)
+(defconstant linger 17)
+(defconstant reconnect-ivl 18)
+(defconstant backlog 19)
+(defconstant recovery-ivl-msec 20)
+(defconstant reconnect-ivl-max 21)
+
+;; send/recv options.
 (defconstant noblock 1)
 (defconstant sndmore 2)
 
-- 
1.7.4.1

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to