Thread.yield();
}
StreamConnection stream = null;
InputStream input = null;
MDSPushInputStream pushInputStream = null;
try {
_notify =
(StreamConnectionNotifier) Connector.open(URL
+ ";deviceside=false");
while (!_stop) {
// NOTE: the following will block until data is received
stream = _notify.acceptAndOpen();
try {
input = stream.openInputStream();
pushInputStream =
new MDSPushInputStream(
(HttpServerConnection) stream, input);
// Extract the data from the input stream
final DataBuffer db = new DataBuffer();
byte[] data = new byte[CHUNK_SIZE];
int chunk = 0;
while (-1 != (chunk = input.read(data))) {
db.write(data, 0, chunk);
}
updateMessage(data);
// If the push server has application level reliabilty
// enabled, this method call will acknowledge receipt
// of the push.
pushInputStream.accept();
data = db.getArray();
} catch (final IOException ioe) {
// A problem occurred with the input stream , however,
// the original