1.0.39.12: remove darwin-langinfo
[sbcl.git] / contrib / sb-bsd-sockets / inet.lisp
index 716095c..869b80f 100644 (file)
@@ -17,6 +17,16 @@ Examples:
 ;;; XXX should we *...* this?
 (defparameter inet-address-any (vector 0 0 0 0))
 
+(defmethod socket-namestring ((socket inet-socket))
+  (ignore-errors
+    (multiple-value-bind (addr port) (socket-name socket)
+      (format nil "~{~A~^.~}:~A" (coerce addr 'list) port))))
+
+(defmethod socket-peerstring ((socket inet-socket))
+  (ignore-errors
+    (multiple-value-bind (addr port) (socket-peername socket)
+      (format nil "~{~A~^.~}:~A" (coerce addr 'list) port))))
+
 ;;; binding a socket to an address and port.  Doubt that anyone's
 ;;; actually using this much, to be honest.
 
@@ -25,7 +35,7 @@ Examples:
 \"127.0.0.1\". Signals an error if the string is malformed."
   (declare (type string dotted-quads))
   (labels ((oops ()
-             (error "~S is not a string designating an IP address." 
+             (error "~S is not a string designating an IP address."
                     dotted-quads))
            (check (x)
              (if (typep x '(unsigned-byte 8))