2 #include "server_interceptor.h"
4 const IOP::ServiceId service_id
= 0xdeadbeef;
5 const char *request_msg
= "12345678";
8 Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void)
9 : myname_ ("Echo_Server_Interceptor")
13 Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void)
18 Echo_Server_Request_Interceptor::name (void)
20 return CORBA::string_dup (this->myname_
);
24 Echo_Server_Request_Interceptor::destroy (void)
29 Echo_Server_Request_Interceptor::receive_request_service_contexts (
30 PortableInterceptor::ServerRequestInfo_ptr ri
)
33 CORBA::String_var operation
= ri
->operation ();
35 printf("%s.receive_request_service_contexts from "
40 IOP::ServiceId id
= ::service_id
;
41 IOP::ServiceContext_var sc
=
42 ri
->get_request_service_context (id
);
45 reinterpret_cast<const char *> (sc
->context_data
.get_buffer ());
48 " Received service context: %C\n",
52 if (strcmp (buf
, request_msg
) != 0)
54 printf("ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: "
55 "Expected request service context to be: %s\n",
64 Echo_Server_Request_Interceptor::receive_request (
65 PortableInterceptor::ServerRequestInfo_ptr
)
71 Echo_Server_Request_Interceptor::send_reply (
72 PortableInterceptor::ServerRequestInfo_ptr
)
77 Echo_Server_Request_Interceptor::send_exception (
78 PortableInterceptor::ServerRequestInfo_ptr
)
83 Echo_Server_Request_Interceptor::send_other (
84 PortableInterceptor::ServerRequestInfo_ptr
)