Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description" : "Networking for the XP Framework: Client and server APIs",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.0",
"xp-framework/core": "^12.11 | ^11.11",
"xp-framework/logging": "^11.0 | ^10.0",
"php" : ">=7.4.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/main/php/peer/SocketException.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace peer;

/**
* Indicate a generic I/O error on a socket
*/
class SocketException extends \io\IOException {
use io\OperationFailed;

/** Indicate a generic I/O error on a socket */
class SocketException extends OperationFailed {

}
5 changes: 3 additions & 2 deletions src/main/php/peer/server/ForkingServer.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace peer\server;

use io\OperationFailed;
use lang\SystemException;

/**
Expand Down Expand Up @@ -34,7 +35,7 @@ public function service() {
while (!$this->terminate) {
try {
$m= $this->socket->accept();
} catch (\io\IOException $e) {
} catch (OperationFailed $e) {
$this->shutdown();
break;
}
Expand Down Expand Up @@ -84,7 +85,7 @@ public function service() {
do {
try {
foreach ($this->protocol->handleData($m) ?? [] as $_) { }
} catch (\io\IOException $e) {
} catch (OperationFailed $e) {
$this->protocol->handleError($m, $e);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/php/peer/server/PreforkingServer.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace peer\server;

use io\OperationFailed;
use lang\RuntimeError;
use util\log\Traceable;

Expand Down Expand Up @@ -130,7 +131,7 @@ public function handleChild() {

try {
foreach ($this->protocol->handleData($m) ?? [] as $_) { }
} catch (\io\IOException $e) {
} catch (OperationFailed $e) {
$this->protocol->handleError($m, $e);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/php/peer/server/Server.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace peer\server;

use io\OperationFailed;
use peer\{BSDServerSocket, ServerSocket};

/**
Expand Down Expand Up @@ -191,7 +192,7 @@ public function service() {
$lastAction[$index]= $currentTime;
try {
foreach ($this->protocol->handleData($handles[$index]) ?? [] as $_) { }
} catch (\io\IOException $e) {
} catch (OperationFailed $e) {
$this->protocol->handleError($handles[$index], $e);
$handles[$index]->close();
unset($handles[$index]);
Expand Down
Loading