Current implementation has the following defects:
* The socket stream ends up with a bogus name as it is created before the socket is connected, making things harder to debug than they need to be.
* In case of error, SB-BSD-SOCKETS:SOCKET-CLOSE was not being called with :ABORT T.
* A unwind from SOCKET-CONNECT that didn't go through the handler leaked an FD.
* An innocent non-error SIGNAL for any reason during SOCKET-CONNECT was taken to be a fatal error due to the handler on type T.
* On datagram sockets CONNECTED-P wasn't set.
Attached patch addresses these issues. Not deeply tested, though.
Cheers,
-- Nikodemus