[cl-irc-devel] Fwd: [cl-irc-cvs] r165 - trunk

Erik Huelsmann ehuels at gmail.com
Thu Jan 4 23:19:30 UTC 2007


Now that I've moved implementation specific socket code, I'd like to
remove implementation specific threading code: the last bit of
implementation specific code we have is located in 'start-process',
which is used by 'start-background-handler'.

When using CLIM to develop GUI apps, CLIM has its own threading which
should be used to handle threads. When *not* using CLIM, developers
can use bordeaux-threads (which uses the CLIM model, but in a
stand-alone library).

All in all, it seems bizarre we take on the problem of providing our
own threading functions. (bordeaux-threads provides threading for ECL,
which we currently don't support in our threading lib; usocket does
support ECL though, so there's nothing but our threading dependency
holding us back)

What I want to do is move 'start-background-handler' to an example
program - which is based on bordeaux-threads - to show first time
users how to get an irc client instance up and running quickly.

Comments?

bye,

Erik.

---------- Forwarded message ----------
From: ehuelsmann at common-lisp.net <ehuelsmann at common-lisp.net>
Date: Jan 4, 2007 11:48 PM
Subject: [cl-irc-cvs] r165 - trunk
To: cl-irc-cvs at common-lisp.net


Author: ehuelsmann
Date: Thu Jan  4 17:48:22 2007
New Revision: 165

Modified:
   trunk/cl-irc.asd
   trunk/command.lisp
   trunk/protocol.lisp
   trunk/utility.lisp
Log:
Change trivial-sockets dependency to usocket as discussed many moons ago.

This commit adds support for all usocket supported lisps, except that
they're not all supported by (cl-irc::start-process ...).


Modified: trunk/cl-irc.asd
==============================================================================
--- trunk/cl-irc.asd    (original)
+++ trunk/cl-irc.asd    Thu Jan  4 17:48:22 2007
@@ -16,7 +16,7 @@
     :version "0.5.2"
     :licence "MIT"
     :description "Common Lisp interface to the IRC protocol"
-    :depends-on (:split-sequence :trivial-sockets :flexi-streams)
+    :depends-on (:split-sequence :usocket :flexi-streams)
     :properties ((#:author-email . "cl-irc-devel at common-lisp.net")
                  (#:date . "$Date$")
                  ((#:albert #:output-dir) . "doc/api-doc/")

Modified: trunk/command.lisp
==============================================================================
--- trunk/command.lisp  (original)
+++ trunk/command.lisp  Thu Jan  4 17:48:22 2007
@@ -249,8 +249,11 @@
                      (connection-type 'connection)
                      (logging-stream t))
   "Connect to server and return a connection object."
-  (let* ((stream (socket-connect server port))
+  (let* ((socket (usocket:socket-connect server port
+                                         :element-type 'flexi-streams:octet))
+         (stream (usocket:socket-stream socket))
          (connection (make-connection :connection-type connection-type
+                                      :socket socket
                                       :network-stream stream
                                       :client-stream logging-stream
                                       :server-name server))

Modified: trunk/protocol.lisp
==============================================================================
--- trunk/protocol.lisp (original)
+++ trunk/protocol.lisp Thu Jan  4 17:48:22 2007
@@ -122,6 +122,9 @@
     :initarg :server-port
     :accessor server-port
     :initform *default-irc-server-port*)
+   (socket
+    :initarg :socket
+    :documentation "Slot to store socket (for internal use only).")
    (network-stream
     :initarg :network-stream
     :accessor network-stream
@@ -199,6 +202,7 @@
                              (password nil)
                              (server-name "")
                              (server-port nil)
+                             (socket nil)
                              (network-stream nil)
                              (outgoing-external-format
*default-outgoing-external-format*)
                              (client-stream t)
@@ -212,6 +216,7 @@
                                    :password password
                                    :server-name server-name
                                    :server-port server-port
+                                   :socket socket
                                    :network-stream network-stream
                                    :output-stream output-stream
                                    :client-stream client-stream)))

Modified: trunk/utility.lisp
==============================================================================
--- trunk/utility.lisp  (original)
+++ trunk/utility.lisp  Thu Jan  4 17:48:22 2007
@@ -101,10 +101,6 @@
         (fourth (ldb (byte 8 0) integer)))
     (vector first second third fourth)))

-(defun socket-connect (server port)
-  "Create a socket connected to `server':`port' and return stream for it."
-  (trivial-sockets:open-stream server port :element-type '(unsigned-byte 8)))
-
 (defun external-format-fixup (format)
   (let ((new-format (copy-list format)))
     (setf (getf (cdr new-format) :eol-style) :crlf)
_______________________________________________
cl-irc-cvs mailing list
cl-irc-cvs at common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cl-irc-cvs



More information about the cl-irc-devel mailing list