Revert "key client sockets on the server-side socket name, not the
peername"
This reverts commit 3303d3b7de
.
This was a bad idea as it prevents the server handling multiple
clients from the same host. The better solution is to store the
client's address and port in the client object rather than rely on the
status of the client's socket.
This commit is contained in:
parent
03b078c20f
commit
85d39627a0
1 changed files with 5 additions and 10 deletions
|
@ -117,18 +117,13 @@
|
|||
;;;=====================================================================
|
||||
|
||||
(defun register-tcp-client (server transmitter)
|
||||
"Clients are keyed on the names-string of the server-side socket,
|
||||
not the peer name because the peer may close the socket after which
|
||||
the peer name is no longer available. FIXME: Maybe we want to store
|
||||
the peername independently of the socket's connection status?"
|
||||
(let ((client-name (make-name-string transmitter)))
|
||||
(when (debug-mode server)
|
||||
(format t "Client registered: ~A~%" client-name))
|
||||
(setf (gethash client-name (clients server)) transmitter)))
|
||||
(setf (gethash (make-peername-string transmitter)
|
||||
(clients server))
|
||||
transmitter))
|
||||
|
||||
(defun unregister-tcp-client (server transmitter)
|
||||
(remhash (make-name-string transmitter)
|
||||
(clients server)))
|
||||
(remhash (make-peername-string transmitter)
|
||||
(clients server)))
|
||||
|
||||
(defun make-unregister-self-fun (server)
|
||||
#'(lambda (client)
|
||||
|
|
Loading…
Reference in a new issue