home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!mimsy!afterlife!news
- From: djasson@zion (Drew Asson)
- Newsgroups: comp.lang.lisp
- Subject: Interprocess comms using Allegro 4.1
- Keywords: IPC, Allegro, socket, stream
- Message-ID: <1992Sep10.171035.13307@afterlife.ncsc.mil>
- Date: 10 Sep 92 17:10:35 GMT
- Sender: news@afterlife.ncsc.mil
- Distribution: usa
- Organization: The Great Beyond
- Lines: 42
-
-
- This is a request for help to set up a unix-domain (socket file) server
- in Allegro (4.1), that will accept 1 connection from a C code client.
- The lisp side only need service one connection at a time (ergo no
- fork needed), but I'd like it to stay resident and be able to accept
- another connection when the last one is finished.
-
- I've looked at the sample code in the ipc.cl file. Setting up a lisp
- client is no problem (just use open-network-stream), but I want a lisp
- server. So I started playing around w/ the function lisp-server-socket-daemon.
- I thought I took out all I needed. But it didn't work.
-
- The first problem was that the ff call to listen didn't block! In C,
- a call to listen will cause the calling process to block until someone
- tries to connect to the socket. In Allegro, the call to listen returned
- immediately (it didn't fail, it just didn't block). Then I decided that
- the process-wait block was used to do that waiting until someone tried
- to connect (using select). I added that to my server code and the problem
- was that the everything seemed to work ... i.e. the process waited until
- a connection was tried, the select worked, but the process never woke up,
- or returned from the process wait, until I hit return in the Lisp listener
- window?
-
- Now, was there something I did wrong? Has anyone else out there written
- a server in Allegro? To reiterate, all I need is a socket based stream
- so that communication can be done between some C code and some Lisp code.
- Writing a server and/or client in C is no problem, so I've implemented it
- w/ a Lisp client and a C server, but this gets me into lots of problems.
-
- Any ideas?
-
- Thanks very much.
-
- --
- djasson@afterlife.ncsc.mil
- US:
- Mr. Drew J. Asson
- 9305 Sombersby Court
- Laurel, MD 20723
-
- (301) 317-1691 (h)
- (301) 688-0346 (w)
-