PHP Requires Chilkat v11.0.0+
Chilkat2 PHP
Example: Socket.AcceptNext method
Demonstrates how to call the AcceptNext method.Chilkat PHP Downloads
<?php
use Chilkat2\Socket;
$listenSocket = new Socket();
$connectedSocket = new Socket();
$port = 5555;
$backlog = 25;
try {
$listenSocket->BindAndListen($port, $backlog);
// Accept next incoming connection
$maxWaitMs = 200000;
$listenSocket->AcceptNext($maxWaitMs, $connectedSocket);
} catch (\Chilkat2\Exception $e) {
echo $e->getMessage(), "\n";
exit;
}
// ...
// ...
$maxWaitMs = 20000;
$connectedSocket->Close($maxWaitMs);