Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
30a107e0
Commit
30a107e0
authored
Jan 13, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timeout parameter for zmq_poll added in cl binding
parent
20a8edcf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
zeromq-api.lisp
bindings/cl/zeromq-api.lisp
+7
-5
zeromq.lisp
bindings/cl/zeromq.lisp
+2
-1
No files found.
bindings/cl/zeromq-api.lisp
View file @
30a107e0
...
...
@@ -146,7 +146,7 @@ The string must be freed with FOREIGN-STRING-FREE."
(
setf
(
mem-aref
int
:long
0
)
value
)
(
%setsockopt
socket
option
int
(
foreign-type-size
:long
))))))
(
defun
poll
(
items
)
(
defun
poll
(
items
&optional
(
timeout
-1
)
)
(
let
((
len
(
length
items
)))
(
with-foreign-object
(
%items
'pollitem
len
)
(
dotimes
(
i
len
)
...
...
@@ -156,14 +156,16 @@ The string must be freed with FOREIGN-STRING-FREE."
(
setf
socket
(
pollitem-socket
item
)
fd
(
pollitem-fd
item
)
events
(
pollitem-events
item
)))))
(
let
((
ret
(
%poll
%items
len
)))
(
if
(
>
ret
0
)
(
let
((
ret
(
%poll
%items
len
timeout
)))
(
cond
((
zerop
ret
)
nil
)
((
>
ret
0
)
(
loop
for
i
below
len
for
revent
=
(
foreign-slot-value
(
mem-aref
%items
'pollitem
i
)
'pollitem
'revents
)
collect
(
setf
(
pollitem-revents
(
nth
i
items
))
revent
))
(
error
(
convert-from-foreign
(
%strerror
*errno*
)
:string
)))))))
collect
(
setf
(
pollitem-revents
(
nth
i
items
))
revent
))
)
(
t
(
error
(
convert-from-foreign
(
%strerror
*errno*
)
:string
)
)))))))
(
defmacro
with-polls
(
list
&body
body
)
`
(
let
,
(
loop
for
(
name
.
polls
)
in
list
...
...
bindings/cl/zeromq.lisp
View file @
30a107e0
...
...
@@ -231,7 +231,8 @@
(
defcfun
(
"zmq_poll"
%poll
)
:int
(
items
:pointer
)
(
nitems
:int
))
(
nitems
:int
)
(
timeout
:long
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Helper functions.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment