[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Send datagrams with no response expected [Important]
Date: Fri, 1 Sep 89 12:37 EDT
From: Barry Margolin <barmar@Think.COM>
In Symbolics 3640 Genera 7.2, System 376.166,
world load FEP0:>rel-7-2-tmc-ver-3.load.1, on Symbolics 3640 #5576 (Occam):
I'm trying to implement the client side of a logging protocol. It is a
datagram protocol. The client simply sends a single UDP datagram with
the logging packet to the log server. The server sends no reply.
There's no receipt confirmation or error checking other than the UDP
I can't see how to implement this common, extremely simple thing with
the Generic Network System. In fact, I can't see how to fill in the UDP
packet at all; the (empty) packet is sent and it starts waiting for a
response before my :INVOKE-WITH-STREAM-AND-CLOSE function is invoked.
In the CHAOS-SIMPLE medium this would be done by putting the data after
the contact name.
I need to know how to do this today.
In 7.2 and 7.4, this is the only mechanism available. Use
CHAOS:DEFINE-CHAOS-PROTOCOL, and stuff the data into the packet by appending
to the contact name string. According to the network implementors, protocols
defined in this way should work over UDP as well.
Here's an example I developed for another customer:
;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10; Package: NETWORK-INTERNALS -*-
;;; First arg to the s-a-p is the universal time to be set.
(chaos:define-chaos-protocol :set-time (:set-time :datagram)
;; This is basically a kludge to get the time into the initial packet.
(:chaos-contact-name (base-contact-name service)
(string-append base-contact-name #\sp
(ut-to-string (first (service-access-path-args service)))))
(:invoke-with-stream-and-close (stream &optional time)
(multiple-value-bind (buffer start end)
(send stream :read-input-buffer)
(send standard-output :string-out (ascii-to-string buffer) start end))))
We are working on a more generic way to do this, however it will not be
available until at least release 7.5.
Please contact me by phone at (800) 824-4263 if you have further urgent
questions on this topic.
-- Chuck Fry
Symbolics Software Support