Corman winapi socket code? 
Author Message
 Corman winapi socket code?

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



Mon, 20 May 2002 03:00:00 GMT  
 Corman winapi socket code?


Quote:
>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



Tue, 21 May 2002 03:00:00 GMT  
 Corman winapi socket code?


Quote:
> 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.



Wed, 22 May 2002 03:00:00 GMT  
 Corman winapi socket code?

Quote:

> 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.



Thu, 23 May 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Contact info for Roger Corman (Corman Lisp)?

2. Using the winapi socket call select() with NetExpress

3. calling winapi without lib or source for winapi lib files

4. CODE: subset of tcl-dp like layer on sun socket code

5. Need some help with Corman Lisp

6. Windows GUI woth Corman Lisp 2.0

7. Another Corman Lisp question

8. Corman Lisp mailing list

9. Interfacing Corman Lisp with WinPcap?

10. cmucl to Corman and back.

11. Corman CL defsystem?

12. Java Integration with Lisp using Corman Lisp

 

 
Powered by phpBB® Forum Software