Merge pull request #2220 from DOCGroup/revert-2217-jwi-inetwraning
[ACE_TAO.git] / TAO / tests / GIOP_Fragments / Java_Big_Request / client.java
blob66d3b3152db6aaf93630d6ae8fdb24ca612dd871
1 // If this server is compiled and run with the JDK ORB, it will
2 // fragment the GIOP Messages sent when more_data() is called.
4 import java.io.FileReader;
5 import java.io.BufferedReader;
6 import org.omg.CORBA.*;
7 import org.omg.PortableServer.*;
8 import Test.Payload_Receiver;
9 import Test.Payload_ReceiverHelper;
11 public class client
13 public static void main (String args[]) {
14 try {
15 ORB orb = ORB.init (args, null);
17 // Get the object reference
18 BufferedReader reader = new BufferedReader (
19 new FileReader ("server.ior"));
20 StringBuffer ior = new StringBuffer();
21 String line = null;
22 while ((line = reader.readLine()) != null) {
23 ior.append(line);
26 org.omg.CORBA.Object obj = orb.string_to_object (ior.toString ());
27 Payload_Receiver receiver = Payload_ReceiverHelper.narrow (obj);
29 // Set up the payload
30 byte [] seq = new byte [1000000];
31 for (int i = 0; i < seq.length; ++i)
32 seq [i] = 'A';
34 // Invoke the method on the server
35 for (int i = 0; i < 20; ++i)
36 receiver.more_data (seq);
38 receiver.shutdown ();
40 catch (Exception e) {
41 System.err.println ("ERROR: " + e);
42 e.printStackTrace (System.out);