Commits

Toby Inkster committed f608bfd

define constants for TCP ports

  • Participants
  • Parent commits 023bf65

Comments (0)

Files changed (8)

lib/SoundSwarm.pm

 package SoundSwarm;
 
-use 5.010;
-use constant { false => 0, true => 1 };
 use strict;
 use warnings;
-use utf8;
+
+use constant {
+	PLAYER_PORT  => 4242,
+	QUEUE_PORT   => 4243,
+	LIBRARY_PORT => 4244,
+};
 
 BEGIN {
 	$SoundSwarm::AUTHORITY = 'cpan:TOBYINK';
 	$SoundSwarm::VERSION   = '0.001';
 }
 
-
-
-
-# Your code goes here
-
-true;
+1;
 
 __END__
 

lib/SoundSwarm/Client/Library.pm

 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4244 },
+	default => sub { SoundSwarm::LIBRARY_PORT },
 );
 
 has host => (

lib/SoundSwarm/Client/Player.pm

-package SoundSwarm::Client::Playing;
+package SoundSwarm::Client::Player;
 
 use SoundSwarm::Syntax;
 use Moo;
 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4242 },
+	default => sub { SoundSwarm::PLAYER_PORT },
 );
 
 has host => (

lib/SoundSwarm/Client/Queue.pm

 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4243 },
+	default => sub { SoundSwarm::QUEUE_PORT },
 );
 
 has host => (

lib/SoundSwarm/Daemon/Library.pm

 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4244 },
+	default => sub { SoundSwarm::LIBRARY_PORT },
 );
 
 has host => (

lib/SoundSwarm/Daemon/Player.pm

 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4242 },
+	default => sub { SoundSwarm::PLAYER_PORT },
 );
 
 has host => (

lib/SoundSwarm/Daemon/Queue.pm

 has port => (
 	is      => 'lazy',
 	isa     => Int,
-	default => sub { 4243 },
+	default => sub { SoundSwarm::QUEUE_PORT },
 );
 
 has host => (

lib/SoundSwarm/Syntax.pm

 package SoundSwarm::Syntax;
 
 use Async ();
+use SoundSwarm;
 use Syntax::Collector -collect => q/
 	use Carp 0 qw( confess );
 	use Scalar::Util 0 qw( blessed );