Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2261

Re: Please help me kill this java thread..... code example

Newsgroups comp.lang.java.help
Date 2012-11-15 07:09 -0800
References <b18cadc9-199f-4900-9f44-b25ec90acbd4@googlegroups.com>
Message-ID <4e56eec9-e5d5-4452-a8c5-de90d175426c@googlegroups.com> (permalink)
Subject Re: Please help me kill this java thread..... code example
From kedward777@gmail.com

Show all headers | View raw


 Here is the scanner while loop:

public synchronized void launchScanner(){
        // Get physical scanner device list
        devList = Symbol.getScannerDeviceList();
        if (devList == null){
            System.out.println("No physical scanner device available");
            return;
        }

        // Create and enable scanner
        try{
                scanner = new Scanner(devList[0]);
                scanner.enable();
                scanEnabled = true;
        }catch (Exception e){
            System.out.println("can't initialize scanner object: " + e.getMessage());
            return;
        }
		
        exiting = false;
        while (!exiting){
            try{
          
                    scanner.read(null, this);
                    wait();
            }catch (Exception e){
                   System.out.println("Got Error: " + e.getMessage());
                return;
            }
        }
			
    }

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Please help me kill this java thread..... code example kedward777@gmail.com - 2012-11-15 07:06 -0800
  Re: Please help me kill this java thread..... code example kedward777@gmail.com - 2012-11-15 07:09 -0800
    Re: Please help me kill this java thread..... code example Knute Johnson <nospam@knutejohnson.com> - 2012-11-15 08:42 -0800
  Re: Please help me kill this java thread..... code example Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-11-15 11:49 -0500
    Re: Please help me kill this java thread..... code example kedward777@gmail.com - 2012-11-15 10:16 -0800
      Re: Please help me kill this java thread..... code example Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-11-15 13:33 -0500
        Re: Please help me kill this java thread..... code example kedward777@gmail.com - 2012-11-15 10:56 -0800
          Re: Please help me kill this java thread..... code example Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-11-15 14:21 -0500
  Re: Please help me kill this java thread..... code example Roedy Green <see_website@mindprod.com.invalid> - 2012-11-15 13:37 -0800

csiph-web