-(defmethod format-address ((address tcp-address))
- (with-slots (host port) address
- (format nil "~A:~D" (if host (format-address host) "*") port)))
-
-(defun inet-resolve-colon-port (string)
- (let ((colon (position #\: string)))
- (if (null colon)
- (error "No colon in TCP address"))
- (if (find #\: string :start (1+ colon))
- (error "More than one colon in TCP address"))
- (let ((port (parse-integer (subseq string (1+ colon))))
- (host (let ((host-part (subseq string 0 colon)))
- (if (equal host-part "*")
- nil
- (resolve-address host-part)))))
- (if (not (typep host '(or null inet-host-address)))
- (error "Must have an internet address for TCP connections"))
- (values host port))))
-
-(defun resolve-tcp-colon-port (address)
- (multiple-value-bind (host port)
- (inet-resolve-colon-port address)
- (make-instance 'tcp-address :host host :port port)))
-
-(export '(tcp-address resolve-tcp-colon-port))