- if (appd.hasClientAppdata() && !(appdatareads % 2 == 0)) {
- // byte[] cappd = appd.getClientAppdata();
- // if (cappd!=null)
- // System.out.println("Client appdata\n"+cappd.toString()+"\nEnd of
- // Appdata\n");
- System.out.println("Testing read from inputstream");
- String cappds = readData(appd.getClientInputStream());
- System.out.println("Client appdata\n" + cappds + "\nEnd of Appdata\n");
- } else {
- if (!writtenonce) {
- String newapd = "Client Appdata:";
- if (appd.hasClientAppdata())
- {
- AppDataInputStream is;
- newapd = readData(is = appd.getClientInputStream());
- is.close();
+ if (clientappd) {
+ if (appd.hasClientAppdata() && !(appdatareads % 2 == 0)) {
+ // byte[] cappd = appd.getClientAppdata();
+ // if (cappd!=null)
+ // System.out.println("Client appdata\n"+cappd.toString()+"\nEnd of
+ // Appdata\n");
+ System.out.println("Testing read from inputstream");
+ String cappds = readData(appd.getClientInputStream());
+ System.out
+ .println("Client appdata\n" + cappds + "\nEnd of Appdata\n");
+ } else {
+ if (!writtenonce) {
+ String newapd = "Client Appdata:";
+ if (appd.hasClientAppdata()) {
+ AppDataInputStream is;
+ newapd = readData(is = appd.getClientInputStream());
+ is.close();
+ }
+ writtenonce = true;
+ // appd.setClientAppdata(makeappData("Client Appdata for
+ // "+user.toString()+" written"));
+ writeData(appd.getClientOutputStream(), newapd
+ + " : Client Appdata for all users written on " + appdatareads
+ + " read by " + vorbaclient.getUserHandle());
+ System.out.println("Written to ClientAppdata stream.");