From: Joshua Sutterfield
Subject: Corman winapi socket code?
Date: 
Message-ID: <3847597d$1@news.cc.umr.edu>
Does anyone know of any pre-written functions for using sockets in Corman 
Lisp?  Corman can call things from DLL's and has lots of stuff for the 
WIN32 API, and even a little demo program that supposedly reads from URLS 
-- but I can't figure how I'd just set up some simple functions to 
open/close connect/accept read/write to sockets thru all that WIN32 
madness.  If no such thing exists.. anyone have suggestions what kind of 
WIN32 funcs I ought to be looking into to begin building these 
functions?  

thanks,
josh

From: Roger Corman
Subject: Re: Corman winapi socket code?
Date: 
Message-ID: <38483543.1303753628@nntp.best.com>
On 2 Dec 1999 23:47:41 -0600, Joshua Sutterfield <·····@umr.edu>
wrote:

>Does anyone know of any pre-written functions for using sockets in Corman 
>Lisp?  Corman can call things from DLL's and has lots of stuff for the 
>WIN32 API, and even a little demo program that supposedly reads from URLS 
>-- but I can't figure how I'd just set up some simple functions to 
>open/close connect/accept read/write to sockets thru all that WIN32 
>madness.  If no such thing exists.. anyone have suggestions what kind of 
>WIN32 funcs I ought to be looking into to begin building these 
>functions?  
>
>thanks,
>josh
I have just added a new file to the Corman Lisp web site:
http://corman.net/CormanLisp.html

there is now a file called winsock.lisp, which can be downloaded
and used to interface to Win32 Winsock functions (socket functions).
Unfortunately you still have to use foreign calls i.e. converting
strings to c-style strings, etc. You may need some kind of reference
on winsock functions to use it.

Roger Corman
From: ········@hotmail.com
Subject: Re: Corman winapi socket code? ... ask dejanews.comm.cormanlist
Date: 
Message-ID: <82a757$ae4$1@nnrp1.deja.com>
In article <··········@news.cc.umr.edu>,
  Joshua Sutterfield <·····@umr.edu> wrote:
> Does anyone know of any pre-written functions for using sockets in
Corman
> Lisp?  Corman can call things from DLL's and has lots of stuff for
the
> WIN32 API, and even a little demo program that supposedly reads from
URLS
> -- but I can't figure how I'd just set up some simple functions to
> open/close connect/accept read/write to sockets thru all that WIN32
> madness.  If no such thing exists.. anyone have suggestions what kind
of
> WIN32 funcs I ought to be looking into to begin building these
> functions?
>
> thanks,
> josh
>
Dear Josh,
CormanLisp has its own newsgroup.  I'm copying your request there
as there are several posters there happy to help with your issues.
Check them out at dejanews.comm.cormanlisp.

Sincerely,
Douglas M. Auclair


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Chris Double
Subject: Re: Corman winapi socket code?
Date: 
Message-ID: <wk7liuhr0g.fsf@double.co.nz>
Joshua Sutterfield <·····@umr.edu> writes:

> Does anyone know of any pre-written functions for using sockets in
> Corman Lisp?

I've written a small package to do socket programming with Corman
Lisp, that uses the WINSOCK package that Roger has provided at his web
site (http://www.corman.net).

It is available at: http://www.double.co.nz/cl/sockets.lisp

You may like to look at it to get an idea of the WINSOCK calls
required to do socket programming. Or use and extend the library for
your own purposes. I'm a Lisp newbie so don't take the code as being
an example of a good Lisp way of doing network programming.

Examples of useage are:

;; Init winsock
(start-sockets)

;; Get an html page
(let ((s (make-client-socket :host "www.microsoft.com" :port 80)))
  (write-socket-line s "GET / HTTP/1.1")
  (write-socket-line s "")
  (loop as line = (read-socket-line s)
    while (> (length line) 0)
    do 
      (progn
        (format t line)
        (terpri)))
        (close-socket s))

;; Do some news server reading
(setq ns (make-client-socket :host "news.someserver.com" :port 119))
(read-socket-line ns)
(write-socket-line ns "help")
(loop as line = (read-socket-line ns)
  while (and (> (length line) 0) (not (eql (elt line 0) #\.)))
  do 
    (progn
      (format t line)
      (terpri)))
(close-socket ns)

;; A simple server that echoes back a single line to the
;; client and closes down.
(let* ((s (make-server-socket :host "localhost" :port 8005))
  (remote-socket (accept-socket s)))
  (format t "Connection made ~A ~A" 
    (socket-descriptor remote-socket) (socket-descriptor s))
  (terpri)
  (let ((value (read-socket-line remote-socket)))
  (format t value)
  (write-socket-line remote-socket value))
  (close-socket remote-socket)
  (close-socket s))



Chris.