How can I attach a message MsgSend to a channel that was opened from another processs. What do I need to do to get the open channel Id and processes of the process reveiving the message.
Receiving process will 1. create a channel, then do a message receive.
Sending process will. 1. attache to channel then do a message send. But how can it get the info for the receiving process. It only knows the name of the receiving process.
This is basic stuff that is well covered in the documentation. In a nutshell your choices are:
- Use name_*()
- Put data in shared memory
- Use resource manager framework.
Just to expand on Mario’s post. What is important to know is that there are no special
“handles” with state information that a client requires to make the connection. If the server
is just doing a ChannelCreate() then a MsgReceive() … all a client will need is a mechanism
by which it can do a ConnectAttach() … which means a node (only if you are distributed),
pid (which you can easily obtain with a name) and channel id (which, in simple scenarios
where you only create one channel will be 1).
The main information is the channel id, which may be a printf() if you are starting/stopping
the client from the command line, or a file, or …
Hope this helps