Skip to content

Commit

Permalink
Rename WsProtocol -> WebsocketProtocol for naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 19, 2025
1 parent 7edfaca commit 9d0f80e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/php/xp/web/srv/Develop.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function serve($source, $profile, $webroot, $docroot, $config, $args, $lo
$impl= new AsyncServer();
$impl->listen(new ServerSocket($this->host, $this->port), Protocol::multiplex()
->serving('http', new ForwardRequests($backend))
->serving('websocket', new WsProtocol(Logging::of(null), new TranslateMessages($backend)))
->serving('websocket', new WebsocketProtocol(new TranslateMessages($backend), Logging::of(null)))
);
$impl->init();
$impl->service();
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/xp/web/srv/Standalone.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function serve($source, $profile, $webroot, $docroot, $config, $args, $lo
$socket= new ServerSocket($this->host, $this->port);
$this->impl->listen($socket, Protocol::multiplex()
->serving('http', new HttpProtocol($application, $environment->logging()))
->serving('websocket', new WsProtocol($environment->logging()))
->serving('websocket', new WebsocketProtocol(null, $environment->logging()))
);
$this->impl->init();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
use util\Bytes;
use websocket\protocol\{Opcodes, Connection};

class WsProtocol extends Switchable {
private $logging, $listener;
class WebsocketProtocol extends Switchable {
private $listener, $logging;
private $connections= [];

/**
* Creates a new protocol instance
*
* @param web.Logging $logging
* @param ?websocket.Listener $listener
* @param web.Logging $logging
*/
public function __construct($logging, $listener= null) {
$this->logging= $logging;
public function __construct($listener, $logging) {
$this->listener= $listener;
$this->logging= $logging;
}

/**
Expand Down

0 comments on commit 9d0f80e

Please sign in to comment.