Skip to content

Commit

Permalink
revert limit
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 27, 2023
1 parent 2b6d622 commit c7ef819
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion config/reverb.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
'enabled' => env('REVERB_SCALING_ENABLED', false),
'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
],
'connection_limit' => env('REVERB_CONNECTION_LIMIT', null),
],

'api_gateway' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Servers/Reverb/Console/Commands/StartServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function handle(): void
$this->subscribeToRedis($loop);
$this->scheduleCleanup($loop);

$server = ServerFactory::make($host, $port, $config['connection_limit'], $loop);
$server = ServerFactory::make($host, $port, $loop);

$this->components->info("Starting server on {$host}:{$port}");

Expand Down
6 changes: 2 additions & 4 deletions src/Servers/Reverb/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ class Factory
/**
* Create a new WebSocket server instance.
*/
public static function make(string $host = '0.0.0.0', string $port = '8080', int $connectionLimit = null, LoopInterface $loop = null)
public static function make(string $host = '0.0.0.0', string $port = '8080', LoopInterface $loop = null)
{
$loop = $loop ?: Loop::get();
$socket = new LimitingServer(
new SocketServer("{$host}:{$port}", [], $loop), $connectionLimit
);
$socket = new SocketServer("{$host}:{$port}", [], $loop);

$router = new Router(new UrlMatcher(static::routes(), new RequestContext));

Expand Down
9 changes: 0 additions & 9 deletions tests/Feature/Reverb/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,6 @@
$this->connect();
});

it('cconnections can be limited', function () {
$this->app['config']->set('reverb.servers.reverb.connection_limit', 1);
$this->stopServer();
$this->startServer();
$this->connect();

$this->connect();
})->throws('Connection closed before handshake');

it('limits the size of messages', function () {
$connection = $this->connect(key: 'pusher-key-3', headers: ['Origin' => 'http://laravel.com']);
$message = $this->send(['This message is waaaaaay longer than the 1 byte limit'], $connection);
Expand Down
2 changes: 1 addition & 1 deletion tests/ReverbTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function usingRedis()
public function startServer($host = '0.0.0.0', $port = '8080')
{
$this->resetFiber();
$this->server = Factory::make($host, $port, config('reverb.servers.reverb.connection_limit'), $this->loop);
$this->server = Factory::make($host, $port, $this->loop);
}

/**
Expand Down

0 comments on commit c7ef819

Please sign in to comment.