ok,  I'll go out on a limb and guess that you're trying for multi-threaded
access/shutdown here... where thread A creates the socket saves a reference
to it somewhere and then goes into accept and you're trying to shut it down
with another thread.

without putting some code to handle shutdown behind your accpet loop logic
you're going to take interrupted exceptions from accpet and/or io exceptions
from close...

------------------------------------

thread A (accept loop) :
do {
        ss.accept();
        //handle connection,
        //must also tolerate
        //close w/o data
} while (! global.shutdown )

------------------------------------

thread B (shutdown thread) :
global.shutdown = true;
sock = new Socket("127.0.0.1", myPort);
sock.close(); //force loop to itterate.

------------------------------------

final class global {
static transient boolean shutdow = false;
}

  cabbey at home dot net <*> http://members.home.net/cabbey
           I want a binary interface to the brain!
Today's opto-mechanical digital interfaces are just too slow!


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to