Skip to content

Commit

Permalink
Remove compatibility with older xp-framework/networking libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 26, 2025
1 parent 11428a4 commit 5490ca6
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/main/php/xp/web/srv/Protocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@ class Protocol implements ServerProtocol {

/** Creates a new instance of this multiplex protocol */
public static function multiplex(): self {

// Compatibility with older xp-framework/networking libraries, see issue #79
// Unwind generators returned from handleData() to guarantee their complete
// execution.
if (class_exists(AsyncServer::class, true)) {
return new self();
} else {
return new class() extends Protocol {
public function handleData($socket) {
foreach (parent::handleData($socket) as $_) { }
}
};
}
return new self();
}

/** Serves a given protocol */
Expand Down

0 comments on commit 5490ca6

Please sign in to comment.