import java.net.*;
import java.io.*;
import java.util.*;

public class ObjServer {
  public static void main(String args[]) throws Exception {
    ServerSocket ssock=new ServerSocket(1234);
    Hashtable hash = new Hashtable();
    hash.put("Dog","Madison");
    hash.put("Cat","Lacey");

    while (true ) {
      System.out.println("Listening");
      Socket sock=ssock.accept();

      ObjectOutputStream ostream=new ObjectOutputStream(
         sock.getOutputStream());
      ostream.writeObject(hash);
      ostream.close();
      sock.close();
      }
    }
  }
