From 8632e84fa2fdd17b23ba76826e95304e75e045d2 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 21 Jul 2000 22:51:02 +0000 Subject: [PATCH] Changes that bring CLASH up to extended HTTP/1.0 support: Made connection an abstract base class from which individual drivers deriver their specific connection classes (like it was intended in the first place). Added generic functions to get the address and hostname of the client. --- src/main/connection.cl | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/connection.cl b/src/main/connection.cl index ffaef8c..c8ba17f 100644 --- a/src/main/connection.cl +++ b/src/main/connection.cl @@ -10,7 +10,12 @@ ;;;; %File Description: ;;;; -;;;; +;;;; This file defines the abstract base class of connection classes. +;;;; A connection keeps all the state that is related to a network +;;;; connection. The implementation-dependent drivers create an +;;;; instance of an implementation-dependent subclass of this for each +;;;; connection they receive and pass it to the responsible server +;;;; object. ;;;; (defconstant +connection-states+ @@ -24,20 +29,11 @@ (defgeneric connection-stream (connection)) +(defgeneric connection-address (connection)) + +(defgeneric connection-hostname (connection)) + (defgeneric close-connection (connection)) (defmethod close-connection :after ((connection connection)) (setf (connection-state connection) :closed)) - -(defclass simple-connection (connection) - ((stream :initarg :stream :reader connection-stream))) - -(defmethod close-connection ((connection simple-connection)) - (handler-case - (close (connection-stream connection)) - (error (condition) - #-CLASH-DEBUG nil - #+CLASH-DEBUG - (format t "~&;;; At ~D Error closing connection ~A:~%;;; ~A~&" - (get-internal-real-time) - connection condition))))