FW: [omniORB] any multi-threading java client will work with this ORB server

paul le paul.le@mail.sprint.com
Mon, 13 Sep 1999 10:55:16 -0500


--openmail-part-1dbf3aca-00000001
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="BDY.RTF"



-----Original Message-----
From: kfeuerma [mailto:kfeuerma@Adobe.COM] 
Sent: Monday, September 13, 1999 10:59 AM
To: paul.le
Cc: kfeuerma
Subject: RE: [omniORB] any multi-threading java client will work with
this ORB server


Paul,

I think the problem here is that omniORB follows a "thread per
connection"
model on the server side, meaning that the same server thread is
handling
all up calls from the same client.  There is probably a way to
instrument
omniORB to do something differently in certain situations, so you may
want
to take a look and the omniORB API to see if you can gain a little more
control over thread/connection management.

At this point, I'm afraid you're at the limit of my knowledge....  Good
luck!

--Ken.


At 04:02 PM 9/10/99 -0500, you wrote:
>I just download the ORBACUS ORB and write a little program with it on
>the client call the C++ server. Here is my code it does not do
>multi-task. one thread is blocked by other thread. 
>
>// - -------- client program
>
>public class Client {
>
>  public static void main( String[] args ) 
>  {
>          // Initialize the ORB.
>          org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null );
>      
>          String ref = null;
>          try{          
>                  ref = args[0]; // ior string
>      
>                  ClientThread c1 = new ClientThread(ref,0); // start
>thread 
>                  ClientThread c2 = new ClientThread(ref,1); // start
>thread
>            } 
>            catch (Exception e)
>            {
>                  e.printStackTrace();
>            }
>
>          
>
>          System.out.println("Done...");
>    
>  }
>}
>
>// --------- THREAD CLASS ------------
>
>class ClientThread extends Thread 
>{
>
>    private String srv;
>    private int _id ;
>    
> 
>      public ClientThread ( String _s ,int id)
>    {
>            srv = _s;
>            _id = id;
>            start();
>    }
>    
>
>    public void run()
>    {
>            20
>            try
>            {
>                  System.out.println("Thread start \n");
>                  
>                  while(true)
>                  {
>                        org.omg.CORBA.ORB orb =
>org.omg.CORBA.ORB.init();
>                        ((com.ooc.CORBA.ORB
>)orb).conc_model(com.ooc.CORBA.ORB.ConcModel.ConcModelThreaded);
>                  
>                  
>            
>                        org.omg.CORBA.Object obj =
orb.string_to_object(
>srv );
>                        Echo manager = EchoHelper.narrow( obj );
>                  
>                        manager.echoString("My Message To Server");
//
>CALL THE SERVER FUCTION
>                        
>                  }
>            
>            }
>            catch(Exception e){}
>    }
>
>}
>
>
>// -------- THIS IS MY SERVER IMPLEMENTATION
>
>class Echo_i : public virtual _sk_Echo {
>public:
>  Echo_i() {}
>  virtual ~Echo_i() {}
>  virtual char * echoString(const char *mesg);
>};
>
>char *
>Echo_i::echoString(const char *mesg) {
>  char *p = CORBA::string_dup(mesg);
>  
>  cerr << "receive msg" << mesg << endl;
>  
>  ::Sleep(10000);
>  cerr << "exit function" << mesg << endl;
>  return p;
>}
>
>
>
>
>thanks
>
>
>
>-----Original Message-----
>From: kfeuerma [mailto:kfeuerma@Adobe.COM]
>Sent: Friday, September 10, 1999 12:03 PM
>To: paul.le
>Cc: kfeuerma
>Subject: RE: [omniORB] any multi-threading java client will work with
>this ORB server
>
>
>Paul,
>
>I'd guess you can find one in the ORBacus download.... at www.ooc.com.
>
>--Ken.
>
>At 10:34 AM 9/10/99 -0500, you wrote:
>>thanks for your reply, do you know where I can find just a simple
>>example.
>>
>>paul
>>
>>-----Original Message-----
>>From: kfeuerma [mailto:kfeuerma@Adobe.COM]
>>Sent: Friday, September 10, 1999 10:34 AM
>>To: paul.le
>>Cc: kfeuerma; omniorb-list
>>Subject: Re: [omniORB] any multi-threading java client will work with
>>this ORB server
>>
>>
>>Yes, from experience doing so.  I use ORBacus on the Java client side
>>with
>>omniORB on the C++ server side.  It works just fine, even to the
extent
>>of
>>doing client call-backs.
>>
>>--Ken Feuerman.
>>
>>
>>At 09:57 AM 9/10/99 -0500, paul le wrote:
>>>
>>>do any one know if I can write a multi-thread java client that will
>>work
>>>with the C++ server written for the Omni ORB
>>>
>>>thanks
>>>
>>
>>
>
>


--openmail-part-1dbf3aca-00000001--