Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LispWorks and sockets...

10 views
Skip to first unread message

David Bakhash

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
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

Anu Triendl

unread,
Jul 10, 1999, 3:00:00 AM7/10/99
to
David Bakhash <ca...@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

David Bakhash

unread,
Jul 10, 1999, 3:00:00 AM7/10/99
to
tri...@adis.at (Anu Triendl) writes:

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

This does not work.

dave

BPer...@computasoft.com

unread,
Jul 12, 1999, 3:00:00 AM7/12/99
to
In article <cxjhfnc...@acs5.bu.edu>,

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.

Nick Levine

unread,
Jul 12, 1999, 3:00:00 AM7/12/99
to
> > David Bakhash <ca...@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

David Bakhash

unread,
Jul 12, 1999, 3:00:00 AM7/12/99
to
"Nick Levine" <Nick....@tesco.net> writes:

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

0 new messages