[erlang-questions] Local and remote sends

Bob Cowdery Bob.Cowdery@REDACTED
Tue Oct 31 13:18:45 CET 2006


On 2006-10-30 16:54, Bob Cowdery wrote:
> Hi
> 
> I have a process that usually sends to a CNode, however, for testing I use erlang processes running in the same session. My sends are of the form:
> {any, From} ! {GatewayPid}
> When I am testing this does not work and gives an argument error on running and I have to change it to:
>>From ! {GatewayPid}
> Is there some form that will work in both situations?

>> is it correct that 'any' is the registered name of a process?
>> and that From is the node name (also atom) you want to reach?
>
>> then sending to From during testing is an error and should not work. you 
>> should have a pid (or registered name), not a node name.
>>
>> i think i must have misunderstood something here.

As far as I can tell I have two different situations. When working locally in one erlang session the From is a Pid (the Pid of the sender to which I am replying) which I need to use directly as the target of the send. When the From is a CNode there is no Pid, just a short name in my case (e.g. c1@REDACTED) and I need to use a tuple to address it like {any, c1@REDACTED}. The 'any' is a registered name but is ignored for all intent and purpose, so it's just any old atom as far as I am concerned. It explains this a bit in the interoperability tutorial on page 20.

I guess I need to test the address and see what form it is. Do you know of any simple way to determin a Pid from a short address apart from looking at the makeup and deducing what it is.

Bob
-- 
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list