/[unetwork]/unetwork/README
ViewVC logotype

Contents of /unetwork/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Wed Mar 24 11:33:19 2004 UTC (10 years ago) by mvilleneuve
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Reflect recent changes
1 UNETWORK
2 Common Lisp networking library
3
4
5 INTRODUCTION
6
7 unetwork is a networking library for Common Lisp. Its goal is to
8 provide a convenient interface to various functionalities and
9 protocols:
10 - TCP and UDP sockets
11 - name resolution
12 - HTTP, FTP, SMTP, POP3, IMAP, NNTP, IRC
13 - and more...
14
15 unetwork is distributed under the terms of the Lisp Lesser General
16 Public License (see http://opensource.franz.com/preamble.html)
17
18
19 REQUIREMENTS
20
21 unetwork requires:
22 - a Lisp system: CMUCL or SBCL (support for others soon).
23 - the PURI package (see http://www.cliki.net/puri, also available
24 as a Linux Debian package: apt-get install cl-puri).
25
26
27 INSTALLATION
28
29 1. Uncompress the archive.
30 2. In /usr/share/common-lisp/systems, create a symbolic link
31 to the system definition file (unetwork.asd).
32 3. In the Lisp system:
33 (asdf:operate 'asdf:load-op 'unetwork)
34
35
36 BASIC USE EXAMPLES
37
38 - HTTP
39
40 (multiple-value-bind (document response-code)
41 (http-get "http://www.common-lisp.net")
42 (print (cdr (assoc :content-type (document-properties document))))
43 (print (document-text document)))
44
45 - HTTP with URL-streams
46
47 (with-uri-input-stream (stream "http://www.common-lisp.net")
48 (loop as line = (read-line stream nil nil)
49 until (null line)
50 do (format t "Line: ~A~%" line)))
51
52 - SMTP
53
54 (with-smtp-connection (socket "smtp.free.fr")
55 (smtp-send-mail socket
56 "matthieu.villeneuve@free.fr"
57 '((:to . "foo@common-lisp.net")
58 (:cc . "bar@common-lisp.net"))
59 "smtp test"
60 "Hello world!"))
61
62 - POP3
63
64 (with-pop3-connection (socket "matthieu.villeneuve"
65 "password" "pop.free.fr")
66 (let ((mail-ids (pop3-get-mail-ids socket)))
67 (dolist (id mail-ids)
68 (let ((document (pop3-get-mail socket id)))
69 (print (document-text socket))))))

  ViewVC Help
Powered by ViewVC 1.1.5