There is a class in the constructor of which an asynchronous listening socket is created. All work with the socket is implemented in this class and an external link to this class is not needed.
The question is how correct this method of creating a class object is.
new Server(); those. without assigning the created instance to a variable. Will such a garbage collector object?
new Server()called? Inmain()? - Sergey Gornostaevnew Server().start();and that's all. - Regent