[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Servers
Sorry... I forgot that we loaded this as part of our site stuff (but also
see the functions SINK-SERVER, etc.).
;;; -*- Mode: LISP; Syntax: Zetalisp; Base: 10; Package: CHAOS -*-
(define-server :ECHO (:medium :chaos :CONN CONN)
(accept conn)
(condition-case (err)
(loop do (send-pkt conn (get-next-pkt conn)))
(sys:error (when conn (remove-conn conn)))))
(define-server :SINK (:medium :chaos :CONN CONN)
(accept conn)
(condition-case (err)
(loop do (return-pkt (get-next-pkt conn)))
(sys:error (when conn (remove-conn conn)))))
(define-server :SOURCE (:medium :chaos :CONN CONN)
(accept conn)
(condition-case (err)
(loop as pkt = (get-pkt)
do (setf (pkt-nbytes pkt) 488.)
(send-pkt conn pkt))
(sys:error (when conn (remove-conn conn)))))
(define-server :UNC-SOURCE (:medium :chaos :conn conn)
(accept conn)
(condition-case (err)
(loop as pkt = (get-pkt)
do (setf (pkt-nbytes pkt) 488.)
(send-unc-pkt conn pkt))
(sys:error (when conn (remove-conn conn)))))
(add-contact-name-for-protocol :echo "ECHO")
(add-contact-name-for-protocol :sink "SINK")
(add-contact-name-for-protocol :source "SOURCE")
(add-contact-name-for-protocol :unc-source "UNC-SOURCE")