You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
619 B

;; Simple sipc server
6 years ago
(let ((*standard-output* (make-broadcast-stream)))
(ql:quickload :cl-sipc))
6 years ago
(defparameter *socket-file* "sipc.socket")
(defparameter *socket* (cl-sipc:bind *socket-file*))
(when (not *socket*)
(format t "[e] binding failed ~a~%" *socket-file*) (quit))
6 years ago
(format t "[+] listening on ~a...~%" *socket-file*)
6 years ago
(let ((rc (cl-sipc:hook *socket*
#'(lambda (err)
(format t "Error: ~a~%" err)
nil)
#'(lambda (type message)
(format t " <- (~a) ~a~%" type message)
6 years ago
(not (eql :close type))))))
(format t "[-] listen rc ~a~%" rc)
6 years ago
(cl-sipc:release *socket*))
(quit)