node_reply_function   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/fleet-node.xtm

Implementation

(bind-func node_reply_function
  "request message in inbuf (length inbuflen), shoudl store pointer to reply message in outbuf & return length of reply message"
  (let ((reply_str:i8* (zalloc 256)))
    (lambda (inbuf:i8* inbuflen:size_t outbuf:i8**)
      (let ((bytes (sprintf reply_str "pingback! received message \"%s\" at time %lld" inbuf (now))))
        (pset! outbuf 0 reply_str)
        bytes))))


Back to Index

Similar Entries