{
ESObject remotesrv = null;
String globalname = null;
if (arguments.length < 1 || arguments.length > 2)
{
throw new EcmaScriptException("Wrong number of arguments for "
+ "constructor RemoteServer");
}
int port = arguments[0].toInt32();
if (arguments.length == 2)
{
globalname = arguments[1].toString();
}
try
{
remotesrv = new FesiRpcServer(port, op, this.evaluator);
if (globalname != null)
{
this.evaluator.getGlobalObject().putProperty(
globalname, remotesrv, globalname.hashCode());
}
}
catch (IOException x)
{
throw new EcmaScriptException(x.toString ());
}
return remotesrv;
}