⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client~1.jav

📁 its a chat server code using javascript
💻 JAV
字号:
package test;

import org.omg.CORBA.*;
import org.omg.CosNaming.*;

public class client
{


public void run()
{
 connect();

  if(myserver != null)
  {
    dosomthing();
  }
}
  protected void connect()
  {
   try
   {
    org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
	NamingContext nc = NamingContextHelper.narrow(obj);
	NameComponent ncmp = new NameComponent("testif"," ");
	NameComponent path[] = { ncmp };

	myserver = testifHelper.narrow(nc.resolve(path));
   }
   catch(Exception e)
   {
    System.out.println("Error connection :"+e);
	myserver = null;
	return ;
   }
 System.out.println("Bound to server");
}

 protected void dosomthing()
 {
   System.out.println("The contents of a is : "+myserver.geta());
   System.out.println("The contents of abc is : "+myserver.getabc());
   myserver.puta((float)23.4);
   myserver.putabc("This is working");
   System.out.println("The contents of a is : "+myserver.geta());
   System.out.println("The contents of abc is : "+myserver.getabc());
  }
  
   public static void main(String[] args)
   {
     orb = ORB.init(args,null);
	 client c = new client();
	 c.run();
   }

   public static ORB orb;
   private testif myserver;




   
    


};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -