2
Hello, good afternoon everyone!
I have a problem with the company’s software. I created a serverSocket when starting the application, and with this I can control so that only one application is opened on the same machine. However, when closing the system, I need to give a . close in the serverSocket created, so that the access to the system is free.
I can in no way create a method that is called in the act of closing the system. In addition to controlling the socket, there are numerous needs that could be implemented in closing the application. So I really need your cooperation. Thank you.
Math, hey, hey, hey! I did the way you said, only I can’t debug, the application is desktop, and when I close (through the same red X) does not pass the stop() method. Anyway, for initial need was to close the socket created, researching found that when closing the application the socket is automatically closed and dispenses with this implementation. Thank you for the reply!
– Anderson Araujo
But can you debug the rest of the code? I circled here and worked ok, including debug
– Math
Did you even build a clean before debugging? Just to confirm, because I can’t imagine what else it might be
– Math
Yes, I did, I removed the comment pq sent wrong to you, look: private Static Serversocket s; @Override public stop() { if (s != null) { Try { s.close(); } catch (Exception ioe) { e.printStackTrace(System.err); } } Platform.Exit(); System.Exit(0); }
– Anderson Araujo