Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void run() {
- if (this.createSocket(this.config.getInt("tcp.port")) == -1) {
- //System.exit(0); //error abort program -- working on it (close resources etc)
- this.shutdown();
- }
- TransferListenerThread trans = new TransferListenerThread(this.serverSocket);
- trans.start();
- BufferedReader in = new BufferedReader (new InputStreamReader (instream));
- while (true) {
- try {
- if (in.readLine().equalsIgnoreCase("shutdown")) {
- trans.shutdown();
- this.shutdown();
- }
- } catch (IOException ex) {
- Logger.getLogger(TransferServer.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- @Override
- public void shutdown() {
- try {
- this.printsream.close();
- this.instream.close();
- // System.exit(0);
- } catch (IOException ex) {
- Logger.getLogger(TransferServer.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment