// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.ObjectOutputStream;
import java.net.Socket;

public class Client {
   public static void main(String[] args) throws Exception {
      Socket s = new Socket("localhost", 10000);
      ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
      int n = 0;
      DummyData dd;
      try {
         while(true) {
            dd = new DummyData();
            oos.writeObject(dd);
            n++;
         }
      } catch (java.lang.OutOfMemoryError e) {
         System.out.println("out of memory after " + n + " writeObject");
      }
   }
}
