/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4607272 6842687
* @summary Unit test for AsynchronousChannelGroup
*/
public class Unbounded {
// number of concurrent completion handlers
// all accepted connections are added to a queue
// create listener to accept connections
}
}
});
// establish lots of connections
for (int i=0; i<CONCURRENCY_COUNT; i++) {
int attempts = 0;
for (;;) {
try {
break;
} catch (IOException x) {
// probably resource issue so back off and retry
if (++attempts >= 3)
throw x;
}
}
}
// the barrier where all threads (plus the main thread) wait
// initiate a read operation on each channel.
for (int i=0; i<CONCURRENCY_COUNT; i++) {
try {
} catch (Exception x) {
throw new AssertionError(x);
}
}
}
});
}
// write data to each of the accepted connections
int remaining = CONCURRENCY_COUNT;
while (remaining > 0) {
remaining--;
}
// wait for all threads to reach the barrier
}
}