for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Async sockets
*
* @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace AsyncSockets\Socket;
use AsyncSockets\Exception\NetworkSocketException;
* Class ClientSocket
class ClientSocket extends AbstractClientSocket
{
/** {@inheritdoc} */
protected function createSocketResource($address, $context)
$resource = stream_socket_client(
$address,
$errno,
$errstr,
null,
STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT,
$context
);
if ($errno || $resource === false) {
throw new NetworkSocketException($this, $errstr, $errno);
}
return $resource;