Files
CLASH/src/main/connection.cl
Pierre R. Mai 8632e84fa2 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.
2000-07-21 22:51:02 +00:00

40 lines
1.2 KiB
Common Lisp

;;;; CLASH --- The Common Lisp Adaptable Simple HTTP server
;;;; This is copyrighted software. See documentation for terms.
;;;;
;;;; connection.cl --- Object to identify a connection.
;;;;
;;;; Checkout Tag: $Name$
;;;; $Id$
(in-package :CLASH)
;;;; %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+
'(:fresh
:read-request :processing-request :write-response :idle
:finished :closed)
"List of states that a connection can be in.")
(defclass connection ()
((state :initarg :stage :initform :fresh :accessor connection-state)))
(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))