GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SPREAD (3)

.ds Aq ’

NAME

Spread - Perl extension for the Spread group communication system

CONTENTS

SYNOPSIS



  use Spread;

  # Connect
  my($mbox, $private_group) = Spread::connect( {
        spread_name => 4444@host.domain.com,
        private_name => mrcool,
        } );

  # If you dont give a private name, youll get a unique name from the spread daemon.
  my($mailbox, $private_group) = Spread::connect(
    spread_name => 4444@host.domain.com,
  );


  # Join and leave groups
  my(@group_to_join) = ( GroupA, GroupB, GroupC );
  my(@joined_groups) = grep( Spread::join($mbox, $_), @group_to_join );
  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!");

  # Poll mailbox
  my($messsize) = Spread::poll($mbox);
  if(defined($messsize)) { print "Next message: $messsize bytes\n"; }
  else { print "Spread::poll $sperrno\n"; }

  # Receive messages (see spreads man pages for more description)
  my($service_type, $sender, $groups, $mess_type, $endian, $message) =
        Spread::receive($mbox);
  my($service_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 -- $sperrno\n"; }



DESCRIPTION

Understanding through practice ;)

See man pages for SP_connect, SP_join, SP_multicast, SP_receive, SP_poll, SP_error, SP_leave, SP_disconnect.

$sperrno holds either the integer spread error or a descriptive string depending on the context in which $sperrno is used.

Exported constants

The predefined groups of exports in the use statements are as follows:

use Spread qw(:SP);

Exports the Spread::connect, Spread::join, Spread::multicast, Spread::receive, Spread::poll, Spread::error, Spread::leave, and Spread::disconnect as SP_connect, SP_join, SP_multicast, SP_receive, SP_poll, SP_error, SP_leave, and SP_disconnect, respectively.

use Spread qw(:ERROR);

Exports all of the error conditions. Please refer to the SP_* C man pages as the RETURN VALUES there have both identical spellings and meanings.

use Spread qw(:MESS);

Exports all of the message types (this is returned as service type by the Spread::receive function and is the request service type of the Spread::multicast function). The actual meaning of these orderings and assurances are not simple to explain without a basic understanding of group communication systems. For more information on this topic, please visit the Spread web site at http://www.spread.org/

All constants in alphabetical order:



  ACCEPT_SESSION
  AGREED_MESS
  BUFFER_TOO_SHORT
  CAUSAL_MESS
  CAUSED_BY_DISCONNECT
  CAUSED_BY_JOIN
  CAUSED_BY_LEAVE
  CAUSED_BY_NETWORK
  CONNECTION_CLOSED
  COULD_NOT_CONNECT
  FIFO_MESS
  HIGH_PRIORITY
  ILLEGAL_GROUP
  ILLEGAL_MESSAGE
  ILLEGAL_SERVICE
  ILLEGAL_SESSION
  ILLEGAL_SPREAD
  LOW_PRIORITY
  MAX_SCATTER_ELEMENTS
  MEDIUM_PRIORITY
  MEMBERSHIP_MESS
  REGULAR_MESS
  REG_MEMB_MESS
  REJECT_ILLEGAL_NAME
  REJECT_MESS
  REJECT_NOT_UNIQUE
  REJECT_NO_NAME
  REJECT_QUOTA
  REJECT_VERSION
  RELIABLE_MESS
  SAFE_MESS
  SELF_DISCARD
  TRANSITION_MESS
  UNRELIABLE_MESS



AUTHOR

Theo Schlossnagle <jesus@cnds.jhu.edu>

SEE ALSO

Various spread documentation at http://www.spread.org/.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SPREAD (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.