Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: TCP i/o in Sun Lucid Message-ID: <1991Jan23.234438.9516@Think.COM> Date: 23 Jan 91 23:44:38 GMT References: <1991Jan23.215610.1176@arris.com> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 27 In article <1991Jan23.215610.1176@arris.com> rshapiro@arris.com (Richard Shapiro) writes: >Is there a simple way to do tcp i/o in Sun Lucid? ... >Does Sun Lucid provide a nice macro like WITH-TCP-STREAM, or even a >simple OPEN-TCP-STREAM function? Perhaps they've generalized OPEN so >that the "file" argument can be a tcp address+port specification? Or >am I stuck doing lower level Unix socket i/o? Lucid has nothing built-in specific to TCP. MAKE-LISP-STREAM can be used to create a Lisp stream connected to a Unix file descriptor. You'll have to use the Unix socket or TLI library (presumably via the foreign function interface) to open the stream, but after calling MAKE-LISP-STREAM you can then use Common Lisp operations. OPEN-TCP-STREAM would call the foreign function and then call MAKE-LISP-STREAM; WITH-OPEN-TCP-STREAM would presumably package the call to OPEN-TCP-STREAM with a WITH-OPEN-STREAM. CLX has to do this, so you might want to look at how it does it. Look at the source for the functions XLIB::OPEN-TCP-STREAM (in dependent.lisp) and XLIB::CONNECT-TO-SERVER (this is a foreign function defined in socket.c as connect_to_server). -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar