Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / Nested_Upcall_Crash / Server_Peer.cpp
blob381072262f8610af03766d5fa7eeb071e87a4873
1 /**
2 * @file Server_Peer.cpp
4 * @author Carlos O'Ryan <coryan@atdesk.com>
5 */
6 #include "Server_Peer.h"
7 #include "tao/debug.h"
9 Server_Peer::Server_Peer (unsigned int seed,
10 CORBA::ORB_ptr orb,
11 CORBA::ULong payload_size)
12 : seed_ (seed)
13 , orb_ (CORBA::ORB::_duplicate(orb))
14 , payload_size_ (payload_size)
18 void
19 Server_Peer::callme(Test::Peer_ptr callback,
20 CORBA::ULong max_depth,
21 Test::Payload const &)
23 int r = ACE_OS::rand_r(&this->seed_) % 50;
25 if(TAO_debug_level)
27 ACE_DEBUG ((LM_DEBUG,
28 "(%P|%t) Server_Peer::callme[%d], r = %d\n",
29 max_depth, r));
32 if(r == 0)
34 try
36 callback->crash();
38 catch (const CORBA::Exception&)
42 // orb_->shutdown (false);
44 else if (max_depth > 0)
46 Test::Peer_var me = this->_this ();
48 Test::Payload extra_data(this->payload_size_);
49 extra_data.length(this->payload_size_);
50 callback->callme(me.in(),
51 max_depth - 1,
52 extra_data);
56 void
57 Server_Peer::crash()
59 throw CORBA::NO_IMPLEMENT ();
62 void
63 Server_Peer::noop()