AsyncCloseChannel.java revision 2362
0N/Apublic class AsyncCloseChannel {
0N/A static int sensorPort;
0N/A static int targetPort;
keepGoing = false;
} catch (Exception e) {}
if (failed)
while(keepGoing) {
new Thread() {
public void run() {
failed = true;
closeIt(s);
}.start();
while (keepGoing) {
acceptCount++;
new Thread() {
public void run() {
boolean empty = true;
if(!empty)
empty = false;
closeIt(s);
}.start();
private static boolean wake;
public void run() {
while (keepGoing) {
s = new Socket();
wait();
wake = false;
if(s != null) {
s.close();
public SensorClient() {
theClient = this;
public static void wakeMe() {
synchronized(theClient) {
wake = true;
volatile boolean ready = false;
public void run() {
while(keepGoing) {
s.finishConnect();
ready = false;
public void run() {
b.clear();
b.flip();
s.write(b);
ready = true;
t.start();
s.close();
t.join();
public ServerThread() {
public void interrupt() {
super.interrupt();
public void run() {
runEx();
if(s != null)
s.close();