From: David Bakhash
Subject: LispWorks and sockets...
Date: 
Message-ID: <cxjiu7t30ic.fsf@acs5.bu.edu>
Hi,

a LispWorks-specific question...

How do you do the equivalent of this 

;; acl:

(setq sock (socket:make-socket :remote-host "host.domain.com"
			       :remote-port 2345))

such that I can read/write to it via format and print:

;; write:
(format s "some forms")
(terpri s)
(finish-output s)

;; then read:
(read-line s)

I tried using (make-instance 'comm:socket-stream) and comm:make-tcp-stream,
but neither did what I wanted.

thanks,
dave

From: Anu Triendl
Subject: Re: LispWorks and sockets...
Date: 
Message-ID: <37870a28.65080410@news.adis.at>
David Bakhash <·····@bu.edu> wrote:
>How do you do the equivalent of this 
>
>;; acl:
>
>(setq sock (socket:make-socket :remote-host "host.domain.com"
>			       :remote-port 2345))

(require "comm")
(setq sock
   (comm:open-tcp-stream "host.domain.com" 2345)))

Anu
From: David Bakhash
Subject: Re: LispWorks and sockets...
Date: 
Message-ID: <cxjhfnc399g.fsf@acs5.bu.edu>
·······@adis.at (Anu Triendl) writes:

> David Bakhash <·····@bu.edu> wrote:
> (require "comm")
> (setq sock
>    (comm:open-tcp-stream "host.domain.com" 2345)))

This does not work.

dave
From: ·········@computasoft.com
Subject: Re: LispWorks and sockets...
Date: 
Message-ID: <7mchld$k6o$1@nnrp1.deja.com>
In article <···············@acs5.bu.edu>,
  David Bakhash <·····@bu.edu> wrote:
> ·······@adis.at (Anu Triendl) writes:
>
> > David Bakhash <·····@bu.edu> wrote:
> > (require "comm")
> > (setq sock
> >    (comm:open-tcp-stream "host.domain.com" 2345)))
>
> This does not work.

This is an html sample, but I'm sure the principal is the same. Try:

(require "comm")
(defun get-html-page (page &optional (server "127.0.0.1"))
  (with-open-stream (conn (comm:open-tcp-stream server 80))
    (format conn "GET ~A HTTP/1.0~C~C~C~C" page
            (code-char 13) (code-char 10)
            (code-char 13) (code-char 10))
    (force-output conn)
    (do ((line (read-line conn nil :EOF)
	       (read-line conn nil :EOF)))
	((eq line :EOF) nil)
      (format t "~A~%" line))))

This works for me in LWW 4.1 personal.

>
> dave
>

barry


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
From: Nick Levine
Subject: Re: LispWorks and sockets...
Date: 
Message-ID: <7mculf$hvg$1@epos.tesco.net>
> > David Bakhash <·····@bu.edu> wrote:
> > (require "comm")
> > (setq sock
> >    (comm:open-tcp-stream "host.domain.com" 2345)))
>
> This does not work.

In what way does it not work? Do you get an error, or what?

- n
From: David Bakhash
Subject: Re: LispWorks and sockets...
Date: 
Message-ID: <cxjpv1x20gj.fsf@acs5.bu.edu>
"Nick Levine" <···········@tesco.net> writes:

> > > David Bakhash <·····@bu.edu> wrote:
> > > (require "comm")
> > > (setq sock
> > >    (comm:open-tcp-stream "host.domain.com" 2345)))
> >
> > This does not work.
> 
> In what way does it not work? Do you get an error, or what?

I don't think that whatever was affecting me should affect anyone else.  I
think comm:open-tcp-stream does the trick.  It might have been the fact that I
was going through a proxy server.

dave