Finalize socket implementation.