anchor.diff:  		communicating with the remote host."))
   
   (defmethod accept-socket ((s server-socket))
  -	(with-fresh-foreign-block (sin-remote 'sockaddr_in)
  -		(with-fresh-foreign-block (size-addr 'long)
  -			(setf (cref (:unsigned-long *) size-addr 0) (sizeof 'sockaddr_in))
  -			(let ((as (with-invalid-socket-check ()
  -					(accept (socket-descriptor s) sin-remote size-addr))))								
  -				(make-instance (remote-socket-class s) 
  -					:descriptor as
  -					:address (cref (:unsigned-long *)sin-remote 1))))))
  +    (let ((remote (malloc *addr-size*)) (addr-size (malloc (sizeof 'int))))
  +        (setf (cref (int *) addr-size *) *addr-size*)
  +        (let ((as (with-invalid-socket-check () (accept (socket-descriptor s) remote addr-size))))
  +            (make-instance (remote-socket-class s) :descriptor as :address (c-to-addr remote)))))
   
   (defgeneric close-socket (s)
   	(:documentation 
  
positive.code: 		"START-SOCKETS"
  		"STOP-SOCKETS"
  		"WITH-SOCKETS-STARTED"
  		"HOST-TO-IPADDR"
  		"IPADDR-TO-NAME"
  		"IPADDR-TO-DOTTED"
  		"BASE-SOCKET"
  
negative.code: 	()
  	(:documentation
  		"A standard socket that is used through a proxy server."))
  
  (defun family (socket) (symbol-value (getf (socket-host-ipaddr socket) :family)))
  
  (defmethod initialize-instance :after ((s base-socket) &allow-other-keys)
  	(ccl:register-finalization s #'(lambda (x) (close-socket x))))
  
  (defmethod initialize-instance ((s local-socket) &key host port &allow-other-keys)
      (call-next-method)
      (setf (socket-host-ipaddr s) (host-to-ipaddr host :port port))
      (setf (socket-descriptor s)
          (with-invalid-socket-check ()
              (socket (family s) SOCK_STREAM 0))))
  
  (defmethod initialize-instance :after ((s local-socket) &allow-other-keys)
      (let ((local (malloc *addr-size*)) (addr-size (malloc (sizeof 'int))))
          (setf (cref (int *) addr-size *) *addr-size*)
          (with-socket-error-check () (getsockname (socket-descriptor s) local addr-size)
              (setf (socket-port s) (getf (c-to-addr local) :port)))))
  
  (defmethod initialize-instance ((s client-socket) &key host port &allow-other-keys)
      (declare (ignore port host))
      (call-next-method)
      (with-socket-error-check () (connect (socket-descriptor s) (addr-to-c (socket-host-ipaddr s)) *addr-size*)))
  
  (defmethod initialize-instance ((s server-socket) &key host port &allow-other-keys)
      (declare (ignore port host))
      (call-next-method)
      (with-socket-error-check () (bind (socket-descriptor s) (addr-to-c (socket-host-ipaddr s)) *addr-size*))
      (with-socket-error-check () (winsock::listen (socket-descriptor s) SOMAXCONN)))
  
  (defmethod initialize-instance :after ((s proxy-socket-mixin) &key real-host real-port proxy &allow-other-keys)
  	(proxy-server-connect proxy s real-host real-port)
  