explicitly closing sockets instead of waiting for garbage collection