Setup management of socket create/close.

Fixed up return-value handling.

(0) -2 +2 +10 +30 tip

mercurial