home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / lisp / 2399 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  2.1 KB

  1. Path: sparky!uunet!dtix!mimsy!afterlife!news
  2. From: djasson@zion (Drew Asson)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Interprocess comms using Allegro 4.1
  5. Keywords: IPC, Allegro, socket, stream
  6. Message-ID: <1992Sep10.171035.13307@afterlife.ncsc.mil>
  7. Date: 10 Sep 92 17:10:35 GMT
  8. Sender: news@afterlife.ncsc.mil
  9. Distribution: usa
  10. Organization: The Great Beyond
  11. Lines: 42
  12.  
  13.  
  14. This is a request for help to set up a unix-domain (socket file) server
  15. in Allegro (4.1), that will accept 1 connection from a C code client.
  16. The lisp side only need service one connection at a time (ergo no
  17. fork needed), but I'd like it to stay resident and be able to accept
  18. another connection when the last one is finished.
  19.  
  20. I've looked at the sample code in the ipc.cl file.  Setting up a lisp
  21. client is no problem (just use open-network-stream), but I want a lisp
  22. server.  So I started playing around w/ the function lisp-server-socket-daemon.
  23. I thought I took out all I needed.  But it didn't work.
  24.  
  25. The first problem was that the ff call to listen didn't block!  In C, 
  26. a call to listen will cause the calling process to block until someone
  27. tries to connect to the socket.  In Allegro, the call to listen returned
  28. immediately (it didn't fail, it just didn't block).  Then I decided that
  29. the process-wait block was used to do that waiting until someone tried
  30. to connect (using select).  I added that to my server code and the problem
  31. was that the everything seemed to work ... i.e. the process waited until
  32. a connection was tried, the select worked, but the process never woke up,
  33. or returned from the process wait, until I hit return in the Lisp listener
  34. window?  
  35.  
  36. Now, was there something I did wrong?  Has anyone else out there written
  37. a server in Allegro?  To reiterate, all I need is a socket based stream
  38. so that communication can be done between some C code and some Lisp code.
  39. Writing a server and/or client in C is no problem, so I've implemented it
  40. w/ a Lisp client and a C server, but this gets me into lots of problems.
  41.  
  42. Any ideas?
  43.  
  44. Thanks very much.
  45.  
  46. --
  47. djasson@afterlife.ncsc.mil
  48. US:
  49.   Mr. Drew J. Asson
  50.   9305 Sombersby Court
  51.   Laurel, MD 20723
  52.  
  53.   (301) 317-1691 (h)
  54.   (301) 688-0346 (w)
  55.