[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun/Symbolics Ethernet I/F
Date: Thu, 12 Jan 89 15:50:18 EST
From: spike@starbase.mitre.org (Ben Bloom)
I have a requirement to pass ascii strings over Ethernet between a
Unix process and a Symbolics process. Could someone do me the
tremendous favor of mailing code &/or instructions to open this 2-way
I/O stream? Free duckpin lessons to the first kind soul.
Thanks,
Ben Bloom
(spike@mitre.arpa)
I have a TCP implimentation for passing strings between two Symbolics
that really works. I use it here on a service call tracker that updates
programs between several Lispms. As we don't have any Suns here, I
can't help you with that side. Hopefully, given this example, someone
could hack some equivalent code together for the Sun side.
This is really a one-way setup that can be invoked separately in each
direction for two-way communication between several machines.
To use this code, the namespace entries for each machine should have a
service triple added. For this example, the triple would be:
SEND-STRING TCP SEND-STRING
[Duckpins??? Can I use my normal bowling balls on those lanes??? (;-) ]
1;;; ------------------------------------------------------------------------------------------
;;; Add port for service
0(tcp:add-tcp-port-for-protocol :send-string 122)
1;;; user protocol ** SENDER **
0(defvar *last-string-out* nil)
(neti:define-protocol :send-string (:send-string :byte-stream)
(:invoke (path)
(with-open-stream
(stream (neti:get-connection-for-service path :characters t))
(send stream ':string-out *last-string-out*))))
1;;; server ** RECEIVER **
0(defvar *last-string-in* (make-string 10000.))
(neti:define-server :send-string
(:medium :byte-stream :stream (stream :accept-p t :characters t))
2(send stream ':string-in nil 0*last-string-in*))
1;;; how to invoke
0(defun send-string (host string)
(setq *last-string-out* string)
(neti:invoke-service-on-host :send-string host))
1;;; ------------------------------------------------------------------------------------------