[Spread-users] Identifying the sender

Jonathan Stanton jonathan at cnds.jhu.edu
Wed Aug 18 09:18:25 EDT 2004

The Spread documentation for the SP_receive call explains what all of the 
fields are. You can find it in the man pages installed with Spread or on 
the web site at www.spread.org/docs/docspread.html in the Users Guide or 
online man pages. 

Specifically, the 'sender' field that is returned to you in the SP_receive 
call holds the private name of the process who sent the message. That name 
will be structured as "#username#daemonname" where 'username' is the name 
each client passed to the SP_connect call (in your case it would be A, B, 
C, D, or E) and the 'daemonname' is name of the daemon that the process 
connected to. 

You can differentiate between multicast and unicast messages by looking at 
the "groups" array returned in the SP_receive call. It lists all of the 
groups and individuals who received the message. So if the only group name 
listed is your personal private group name ("#A#machine1") then it was a 
unicast message to you, if one or more  regular group names are in the 
field then it was a multicast sent to all of those groups. 

If you are using an API wrapper for a language other then C, the syntax 
might be slightly different but the content and ideas are the same. 



On Wed, Aug 18, 2004 at 11:20:57AM +0000, Gustavo Castro wrote:
> Hello, i´m a newbie with the spread, so this question should be easy. I 
> have a spread group, let´s call it "Test" with 5 members, name A, B, C, D 
> and E. If one of the members send a message, how can i know who is the 
> sender? I mean, if A sends a message and E receives it, how can E possibly 
> know that A was the sender? And if it was a multicast?
> Thanks in advance!

Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    

More information about the Spread-users mailing list