void ServerApp::collocated_setup() { int custom_client_id_start = this->num_remote_clients_; unsigned servant_index = 0; for (unsigned i = 0; i < this->num_collocated_clients_; i++) { if (i > 0) { // Dole out the servant object references in a round-robin fashion. servant_index = (servant_index + 1) % this->num_servants_; } ServantListType::T_stub_var obj = this->servants_.objref(servant_index); ClientEngine_Handle engine = new Foo_C_Custom_ClientEngine(this->servants_.servant(servant_index), obj.in(), this->tp_strategy_.in(), ++ custom_client_id_start); this->collocated_client_task_.add_engine(engine.in()); } }
void ServerApp::collocated_setup() { int client_id_start = this->num_remote_clients_; for (unsigned i = 0; i < this->num_collocated_clients_; i++) { // Dole out the servant object references in a round-robin fashion. unsigned servant_index = i % this->num_servants_; ServantListType::T_stub_var obj = this->servants_.objref(servant_index); ClientEngine_Handle engine = new Foo_A_ClientEngine(obj.in(), ++client_id_start, true); this->collocated_client_task_.add_engine(engine.in()); } }
void ClientApp::client_setup(void) { // Turn the ior_ into a Foo_B obj ref. Foo_B_var foo = RefHelper<Foo_B>::string_to_ref(this->orb_.in(), this->ior_.c_str()); this->servants_.create_and_activate(1, // number of callback servants this->poa_.in()); ServantListType::T_stub_var cb = this->servants_.objref(0); // Create the ClientEngine object, and give it the Foo_B and Callback object // references. ClientEngine_Handle engine = new Foo_B_ClientEngine(foo.in(), cb.in (), this->client_id_); this->client_task_.add_engine(engine.in()); }