// server is primary; the client must therefore try to connect
// to each server in turn:
if (items[0].isReadable()) {
// We got a reply from the server, must match sequence
String reply = client.recvStr();
if (Integer.parseInt(reply) == sequence) {
System.out.printf ("I: server replied OK (%s)\n", reply);
expectReply = false;
Thread.sleep(1000); // One request per second
}