Test.java revision 3112
152N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 152N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 152N/A * This code is free software; you can redistribute it and/or modify it 152N/A * under the terms of the GNU General Public License version 2 only, as 152N/A * published by the Free Software Foundation. 152N/A * This code is distributed in the hope that it will be useful, but WITHOUT 152N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 152N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 152N/A * version 2 for more details (a copy is included in the LICENSE file that 152N/A * accompanied this code). 152N/A * You should have received a copy of the GNU General Public License version 152N/A * 2 along with this work; if not, write to the Free Software Foundation, 152N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 152N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 152N/A * or visit www.oracle.com if you need additional information or have any 152N/A // open TCP connection without sending anything. Check server closes it. // server should close connection after 2 seconds. We wait up to 10 // send request and don't read response. Check server closes connection // we won't read response and check if it times out // on server. If it timesout at client then there is a problem // same as test2, but repeated with multiple connections // Worker: a thread opens a connection to the server in one of three modes. // NORMAL - sends a request, waits for response, and checks valid response // REQUEST - sends a partial request, and blocks, to see if // server closes the connection. // RESPONSE - sends a request, partially reads response and blocks, // to see if server closes the connection. REQUEST,
// block during sending of request RESPONSE,
// block during reading of response fail(
"Worker: failed to connect to server");
fail (
"Worker: response");
fail(
"Worker: timedout");
fail(
"Worker: timedout");
static final int NUM =
20;
for (
int i=
0; i<
NUM; i++) {
for (
int i=
0; i<
NUM*
3; i++) {
byte[]
buf =
new byte [
64];