[Spread-users] [patch] Spread.pm documentation

Ask Bjoern Hansen ask at develooper.com
Thu Apr 19 07:12:53 EDT 2001


A patch to the documentation of Spread.pm with the few things I ran
into while playing around with it. :-)

 - ask


--- Spread.pm.org	Thu Apr 19 04:07:53 2001
+++ Spread.pm	Thu Apr 19 04:10:02 2001
@@ -176,35 +176,35 @@
   use Spread;
 
   # Connect
-  my($mailbox, $private_group) = Sread::connect(
-	spread_name => '4444 at host.domain.com',
-	private_name => 'mrcool',
+  my($mbox, $private_group) = Spread::connect(
+	{ spread_name => '4444 at host.domain.com',
+	  private_name => 'mrcool' },
 	);
 
   # Join and leave groups
   my(@group_to_join) = ( 'GroupA', 'GroupB', 'GroupC' );
   my(@joined_groups) = grep( Spread::join($mbox, $_), @group_to_join );
-  print "Spread::join -- $sperrorno"
+  print "Spread::join -- $sperrno"
   	unless (Spread::leave($mbox, 'GroupC'));
 
   # Multicast to group(s)
   Spread::multicast($mbox, AGREED_MESS, 'GroupB', 0, "Hey you!");
-  Spread::multicast($mbox, SAFE_MESS, @joined_groups, 0, "Hey yall!");
+  Spread::multicast($mbox, SAFE_MESS, [@joined_groups], 0, "Hey yall!");
 
   # Poll mailbox
-  my($messsize) = Spread::poll($mbox);
-  if(defined($messsize)) { print "Next message: $messsize bytes\n"; }
+  my ($messsize) = Spread::poll($mbox);
+  if (defined($messsize)) { print "Next message: $messsize bytes\n"; }
   else { print "Spread::poll $sperrno\n"; }
 
   # Receive messages (see spread's man pages for more description)
-  my($sevice_type, $sender, $groups, $mess_type, $endian, $message) =
+  my ($sevice_type, $sender, $groups, $mess_type, $endian, $message) =
 	Spread::receive($mbox);
-  my($sevice_type, $sender, $groups, $mess_type, $endian, $message) =
+  my ($sevice_type, $sender, $groups, $mess_type, $endian, $message) =
 	Spread::receive($mbox, 1.789);  # 1.789 second timeout on receive
 
   # Disconnect
-  if(Spread::disconnect($mbox)) { print "Successful disconnect\n"; }
-  else { print "Spread::disconnect -- $sperrorno\n"; }
+  if (Spread::disconnect($mbox)) { print "Successful disconnect\n"; }
+  else { print "Spread::disconnect -- $sperrno\n"; }
 
 =head1 DESCRIPTION
 


-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();







More information about the Spread-users mailing list