+
+(defun ipaddr-array-to-dotted (array)
+ (format nil "~{~D~^.~}" (coerce array 'list))
+ #+ignore
+ (format nil "~D.~D.~D.~D"
+ (aref 0 array) (aref 1 array) (aref 2 array) (array 3 array)))
+
+(defun remote-host (socket)
+ #+allegro (socket:ipaddr-to-dotted (socket:remote-host socket))
+ #+lispworks (nth-value 0 (comm:get-socket-peer-address socket))
+ #+sbcl (ipaddr-array-to-dotted
+ (nth-value 0 (sb-bsd-sockets:socket-peername socket)))
+ #+cmu (nth-value 0 (ext:get-peer-host-and-port socket))
+ #+clisp (let* ((peer (ext:socket-stream-peer socket t))
+ (stop (position #\Space peer)))
+ ;; 2.37-2.39 had do-not-resolve-p backwards
+ (if stop (subseq peer 0 stop) peer))
+ #+openmcl (ccl:remote-host socket)
+ )
+