Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* peer to peer impossible in dce?
@ 1993-06-07 15:12 Glen Diener
  1993-06-07 19:28 ` Rich Salz
  1993-06-08 15:24 ` Greg Brail
  0 siblings, 2 replies; 3+ messages in thread
From: Glen Diener @ 1993-06-07 15:12 UTC (permalink / raw)


There is a very simple peer to peer communication situation
which I haven't been able to implement in DCE RPC, and
I'm wondering if anyone else has tried anything similar:

Suppose we have two processes, X and Y, and one rpc procedure
called ping().  X wants to send ping()'s to Y, and also to reply to
incoming ping()'s from Y.  This means that X needs to be both 
client--to send the ping()'s, and server--to reply to the ping()'s.

Unfortunately, as far as I can tell, this is not possible in DCE.
X cannot, for example, link both the client stub,
the server stub, and a method definition for ping()...the method
definition will end up clashing with a definition for ping in
the  client stub, and produce a multiply-defined symbol at link time.

Does DCE's client-server architecture make all such peer-to-peer
communication completely impossible, or is there some way around
it?

-glen diener




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: peer to peer impossible in dce?
  1993-06-07 15:12 peer to peer impossible in dce? Glen Diener
@ 1993-06-07 19:28 ` Rich Salz
  1993-06-08 15:24 ` Greg Brail
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Salz @ 1993-06-07 19:28 UTC (permalink / raw)


In <1993Jun7.151247.2332@walter.bellcore.com> grd@scherzo.bellcore.com (Glen Diener) writes:
>X cannot, for example, link both the client stub,
>the server stub, and a method definition for ping()...the method
>definition will end up clashing with a definition for ping in
>the  client stub, and produce a multiply-defined symbol at link time.

You should be able to do this by doing the following:
    -	Write your "ping" operation implementation, but call it
	something like my_ping_op or some such.
    -	Take a look at the generated server_stub file and pull out
	the manager_epv part -- it will be a custom structure that
	has one function pointer for each operation.
    -	Copy the variable (separating the variable from its typedef
	may be tricky :-) into one of your server source files and replace
	"ping" with my_ping_op.
    -	Run IDL with the -no_mepv flag.
Compile and link as normal.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: peer to peer impossible in dce?
  1993-06-07 15:12 peer to peer impossible in dce? Glen Diener
  1993-06-07 19:28 ` Rich Salz
@ 1993-06-08 15:24 ` Greg Brail
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Brail @ 1993-06-08 15:24 UTC (permalink / raw)


In article <1993Jun7.151247.2332@walter.bellcore.com> grd@scherzo.bellcore.com (Glen Diener) writes:
>There is a very simple peer to peer communication situation
>which I haven't been able to implement in DCE RPC, and
>I'm wondering if anyone else has tried anything similar:
>
>Suppose we have two processes, X and Y, and one rpc procedure
>called ping().  X wants to send ping()'s to Y, and also to reply to
>incoming ping()'s from Y.  This means that X needs to be both 
>client--to send the ping()'s, and server--to reply to the ping()'s.

To do this, you must define your own "manager entry point vector", or
mepv. This is a structure that contains a function pointer to each
server-side function. The RPC runtime uses this data structure to
determine which functions to call for each server-side RPC. It'll call
whatever function each function pointer points to. The definition of
your interface's mepv will be in the .h file generated by idl. It has
"epv_t" at the end of its name, so if your server's interface handle
is Server_v1_0_s_ifspec, the mepv is Server_v1_0_epv_t.

You must allocate one of these structures and make the function
pointers in it point to your server functions. To make this work, you
give your server functions different names than the names you
specified in the IDL file. 

The third parameter of rpc_server_register_if is a pointer to an
rpc_mgr_epv_t, which is what you want. Normally one passes NULL to
this parameter, but in this case, pass a pointer to your mepv
structure.

Also, you must run IDL with the -no_mepv option if you want to do this.
Otherwise, IDL generates an mepv for you that just calls the server
functions with "regular" names. (Consequently, if you run IDL with
no_mepv and you don't create your own mepv, all your RPC calls will
crash your server.)

Now, you call the "normal" RPC function when you want to talk to
another RPC server. When you want to call one of your server
functions, you use the function name you assigned to the mepv structure.

				greg
-- 
Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1993-06-08 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-06-07 15:12 peer to peer impossible in dce? Glen Diener
1993-06-07 19:28 ` Rich Salz
1993-06-08 15:24 ` Greg Brail

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox