App-SocialCalc-Multiplayer

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

name: App-SocialCalc-Multiplayer
no_index:
  directory:
    - inc
    - socialcalc
requires:
  File::ShareDir: 0
  Fliggy: 0
  JSON: 0
  Protocol::WebSocket: 0
  Try::Tiny: 0
  perl: 5.8.1
resources:
  repository: http://github.com/audreyt/socialcalc
version: 20110626

Makefile.PL  view on Meta::CPAN

license         'CPAL';
repository      'http://github.com/audreyt/socialcalc';
all_from        'Multiplayer.pm';
readme_from     'Multiplayer.pm';
requires        'Fliggy';
requires        'File::ShareDir';

# These are requirements to PocketIO.pm
requires        'Protocol::WebSocket';
requires        'JSON';
requires        'Try::Tiny';

install_share   'socialcalc';
install_script  'socialcalc-multiplayer.pl';

WriteAll;

1;

socialcalc/README  view on Meta::CPAN

                                -=[Multiplayer Socialcalc]=-

  >> See https://github.com/audreyt/socialcalc/wiki for an upcoming book chapter on this project! <<

                                .oO( Setup Instructions )Oo.

0. Install JSON, Fliggy, Protocol::WebSocket and Try::Tiny:

    sudo cpan
    cpan> notest install JSON Fliggy Protocol::WebSocket Try::Tiny

1. Then check out this project and run the stand-alone server:

    git clone git://github.com/audreyt/socialcalc.git

    cd socialcalc
    perl multiserver.pl

2. Open port 9999 in multiple browsers with WebSocket support.

socialcalc/third-party/lib/PocketIO/Connection.pm  view on Meta::CPAN

package PocketIO::Connection;

use strict;
use warnings;

use AnyEvent;
use JSON ();
use Encode ();
use Try::Tiny;

use PocketIO::Pool;

use constant DEBUG => $ENV{POCKETIO_CONNECTION_DEBUG};

sub new {
    my $class = shift;

    my $self = {@_};
    bless $self, $class;

socialcalc/third-party/lib/PocketIO/Transport/Base.pm  view on Meta::CPAN

package PocketIO::Transport::Base;

use strict;
use warnings;

use JSON   ();
use Encode ();
use Try::Tiny;
use Scalar::Util qw(weaken);

use Plack::Request;
use PocketIO::Handle;
use PocketIO::Pool;

sub new {
    my $class = shift;

    my $self = bless {@_}, $class;



( run in 0.344 second using v1.01-cache-2.11-cpan-05444aca049 )