socket streams

"Eric Blood" <[email protected]> Tue, 13 May 2003 17:56:09 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
I am running into a problem with socket streams.  The simplest case I
have is modified from sockets.lisp:

(require 'sockets)
(use-package 'sockets)
(start-sockets)

(let ((s (make-client-socket :host "www.double.co.nz" :port 80)))
  (let ((stream (make-socket-stream s)))
    (write-line "GET / HTTP/1.0" stream)
    (write-line "" stream)
    (loop as line = (read-line stream)
          until (eq line :eof)
          do (format t "~A~%" line)))
  (close-socket s))

I am getting an INVALID-KEY-ARG error, but I am not sure why.  Any
hints on how I should debug this would be greatly appreciated.

Below is the stack trace...

-- 
eblood

;;; An error occurred in function INVALID-KEY-ARG:
;;; Error: The passed key NIL is not defined for this function
;;; Entering Corman Lisp debug loop. 
;;; Use :C followed by an option to exit. Type :HELP for help.
;;; Restart options:
;;; 1   Abort to top level.
:b
;;; ERROR                               (File sys/conditions.lisp,
line 463)
;;; #< COMPILED-FUNCTION: #xF8CF21 >
;;; #< COMPILED-FUNCTION: #xF88C37 >
;;; #< COMPILED-FUNCTION: #xF8A823 >
;;; #< COMPILED-FUNCTION: #xF96AA7 >
;;; WRITE-LINE                          (File sys/write.lisp, line 101)
;;; FUNCALL                             (File sys/clos.lisp, line 1846)
;;; SOCKETS::NEW-WRITE-LINE             (File
C:\devel\cormanlisp\MODULES\SOCKETS.lisp, line 817)
;;; #< COMPILED-FUNCTION: #x10EA578 >
;;; FUNCALL                             (File sys/clos.lisp, line 1846)
;;; EVAL                                (File sys/misc.lisp, line 1026)
;;; TOP-LEVEL                           (File sys/win-conditions.lisp,
line 64)
:n
;;; Call to function #< COMPILED-FUNCTION: #xF8CF21 >:
;;; No debugging information is available for this function.
:n
;;; Call to function #< COMPILED-FUNCTION: #xF88C37 >:
;;; No debugging information is available for this function.
:n
;;; Call to function #< COMPILED-FUNCTION: #xF8A823 >:
;;; No debugging information is available for this function.
:n
;;; Call to function #< COMPILED-FUNCTION: #xF96AA7 >:
;;; No debugging information is available for this function.
:n
;;; Call to function WRITE-LINE:        (File sys/write.lisp, line 101)
;;;  COMMON-LISP::END:        NIL
;;;  COMMON-LISP::START:      0
;;;  COMMON-LISP::OUTPUT-STREAM: #< SOCKET-STREAM NIL DIRECTION
BIDIRECTIONAL >
;;;  STRING:                  "GET / HTTP/1.0
"
:n
;;; Call to function FUNCALL:           (File sys/clos.lisp, line 1846)
;;; No debugging information is available for this function.
:n
;;; Call to function SOCKETS::NEW-WRITE-LINE: (File
C:\devel\cormanlisp\MODULES\SOCKETS.lisp, line 817)
;;;  SOCKETS::END:            NIL
;;;  SOCKETS::START:          NIL
;;;  SOCKETS::OUTPUT-STREAM:  #< SOCKET-STREAM NIL DIRECTION
BIDIRECTIONAL >
;;;  STRING:                  "GET / HTTP/1.0"
;;;  STRING:                  "GET / HTTP/1.0"
:n
;;; Call to function #< COMPILED-FUNCTION: #x10EA578 >:
;;;  S:                       #<Client-Socket #x10EA730>
;;;  STREAM:                  #< SOCKET-STREAM NIL DIRECTION
BIDIRECTIONAL >
;;;  LINE:                    NIL
:n
;;; Call to function FUNCALL:           (File sys/clos.lisp, line 1846)
;;; No debugging information is available for this function.
:n
;;; Call to function EVAL:              (File sys/misc.lisp, line 1026)
;;;  COMMON-LISP::FORM:       (LET ((S (MAKE-CLIENT-SOCKET :HOST
"www.double.co.nz" :PORT 80))) (LET ((STREAM (MAKE-SOCKET-STREAM S)))
(WRITE-LINE "GET / HTTP/1.0" STREAM) (WRITE-LINE "" STREAM) (LOOP AS
LINE = (READ-LINE STREAM) UNTIL (EQ LINE :EOF) DO (FORMAT T "~A~%"
LINE))) (CLOSE-SOCKET S))
;;;  COMMON-LISP::HOOKFN:     NIL
;;;  COMMON-LISP::COMPILED-FORM: #< COMPILED-FUNCTION: #x10EA578 >
;;;  COMMON-LISP::*EVALHOOK*: NIL
:n
;;; Bottom of stack.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/