FileDocCategorySizeDatePackage
Person_Stub.javaAPI DocExample1286Fri Mar 05 06:03:36 GMT 1999None

Person_Stub

public class Person_Stub extends Object implements Person

Fields Summary
Socket
socket
Constructors Summary
public Person_Stub()

       // create a network connection to the skeleton.
       // Replace "myhost" with your own IP Address of your computer.
       socket = new Socket("e194z",9000);
    
Methods Summary
public intgetAge()

       // when this method is invoked, stream the method name to the
       // skeleton
       ObjectOutputStream outStream
           = new ObjectOutputStream(socket.getOutputStream());
       outStream.writeObject("age");
       outStream.flush();
       ObjectInputStream inStream = new
           ObjectInputStream(socket.getInputStream());
       return inStream.readInt();
    
public java.lang.StringgetName()

        // when this method is invoked, stream the method name to the
        // skeleton
        ObjectOutputStream outStream
            = new ObjectOutputStream(socket.getOutputStream());
        outStream.writeObject("name");
        outStream.flush();
        ObjectInputStream inStream = new
            ObjectInputStream(socket.getInputStream());
        return (String)inStream.readObject();