Commit 9002c4c8 authored by Eric Marsden's avatar Eric Marsden

Add unix-domain socket support for Allegro CL (tested with Express

edition for Linux/x86).
parent 101246fa
......@@ -17,9 +17,8 @@
(defsystem :pg
:name "Socket-level PostgreSQL interface"
:author "Eric Marsden"
:version "0.22"
:version "0.24"
:depends-on (
#+allegro :socket
#+lispworks "comm"
#+cormanlisp :sockets
#+sbcl :sb-bsd-sockets
......
;;; sysdep.lisp -- system-dependent parts of pg-dot-lisp
;;;
;;; Author: Eric Marsden <eric.marsden@free.fr>
;;; Time-stamp: <2006-09-24 emarsden>
;;; Time-stamp: <2006-09-30 emarsden>
;;
;;
(in-package :postgresql)
(eval-when (:compile-toplevel :load-toplevel :execute)
#+allegro (require :socket)
#+lispworks (require "comm")
#+cormanlisp (require :sockets)
#+armedbear (require :socket))
......@@ -165,14 +164,22 @@
(defun socket-connect (port host)
(declare (type integer port))
(handler-case
(socket:make-socket :remote-host host
:remote-port port
:format :binary)
(error (e)
(if (eql #\/ (char host 0))
(socket:make-socket :type :stream
:address-family :file
:connect :active
;; :local-filename (format nil "~A.s.PGSQL.~D" (string host) port)
:remote-filename (format nil "~A.s.PGSQL.~D" (string host) port)
:format :binary)
(socket:make-socket :remote-host host
:remote-port port
:connect :active
:format :binary))
(error (e)
(error 'connection-failure
:host host
:port port
:transport-error e))))
:host host
:port port
:transport-error e))))
;; Lispworks 4.2 doesn't seem to implement WRITE-SEQUENCE on binary
;; streams. Fixed in version 4.3.
......@@ -283,6 +290,9 @@
(eval-when (:load-toplevel :execute :compile-toplevel)
(require :socket))
;; could provide support for connections via a unix-domain socket by
;; using http://freshmeat.net/projects/j-buds/ (requires linking to a
;; shared libary)
#+armedbear
(defun socket-connect (port host)
(declare (type integer port))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment