public Object call(int objectid, int methodid, Object[] args)
        throws RemoteException
    {
        boolean result;
        Object rvalue;
        String errmsg;

        try {
            /* This method establishes a raw tcp connection for sending
             * a POST message.  Thus the object cannot communicate a
             * remote object beyond a fire wall.  To avoid this problem,
             * the connection should be established with a mechanism
             * collaborating a proxy server.  Unfortunately, java.lang.URL
             * does not seem to provide such a mechanism.
             *
             * You might think that using HttpURLConnection is a better
             * way than constructing a raw tcp connection.  Unfortunately,
             * URL.openConnection() does not return an HttpURLConnection
             * object in Netscape's JVM.  It returns a
             * netscape.net.URLConnection object.
             *
             * lookupObject() has the same problem.
             */
            Socket sock = new Socket(servername, port);
            OutputStream out = new BufferedOutputStream(
                                                sock.getOutputStream());
            out.write(rmiCommand);
            out.write(endofline);
            out.write(endofline);

            ObjectOutputStream dout = new ObjectOutputStream(out);
            dout.writeInt(objectid);
            dout.writeInt(methodid);
            writeParameters(dout, args);
            dout.flush();

            InputStream ins = new BufferedInputStream(sock.getInputStream());
            skipHeader(ins);
            ObjectInputStream din = new ObjectInputStream(ins);
            result = din.readBoolean();
            rvalue = null;
            errmsg = null;
            if (result)
                rvalue = din.readObject();
            else
                errmsg = din.readUTF();

            din.close();
            dout.close();
            sock.close();

            if (rvalue instanceof RemoteRef) {
                RemoteRef ref = (RemoteRef)rvalue;
                rvalue = createProxy(ref.oid, ref.classname);
            }
        }
        catch (ClassNotFoundException e) {
            throw new RemoteException(e);
        }
        catch (IOException e) {
            throw new RemoteException(e);
        }
        catch (Exception e) {
            throw new RemoteException(e);
        }

        if (result)
            return rvalue;
        else
            throw new RemoteException(errmsg);
    }