fix registering socket resource
tests cleanup