any full solution on "socket blocking on read()"?

I saw many discussion on this,but no full solution available,any one can give me some advice or example?
[118 byte] By [dcesh] at [2007-9-26 12:33:41]
# 1
The anwer from Sun is one:Socket isn't part of MIDP specification. Any bugs you meat - it's your own problem :)))-Rico
kvirtu-rico at 2007-7-2 9:55:11 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

As for me I do follows:

Make another thread, that controls some flag. If flag signals "stop waiting" - i close this connection.

public run() {

while (!someFlag) {

sleep(10); //for example

}

inputStream.close();

}

static public void initRead() {

start(); // starts another thread

inputStream.read();

}

-Rico

kvirtu-rico at 2007-7-2 9:55:11 > top of Java-index,Java Mobility Forums,Java ME Technologies...