cleaning up socket lifecycle