@@ -155,7 +155,7 @@ |
||
| 155 | 155 | private function setConnectionFinishTime(OperationMetadata $operationMetadata) |
| 156 | 156 | { |
| 157 | 157 | $meta = $operationMetadata->getMetadata(); |
| 158 | - $wasConnected = $meta[ RequestExecutorInterface::META_CONNECTION_FINISH_TIME ] !== null; |
|
| 158 | + $wasConnected = $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null; |
|
| 159 | 159 | $this->setSocketOperationTime($operationMetadata, RequestExecutorInterface::META_CONNECTION_FINISH_TIME); |
| 160 | 160 | if (!$wasConnected) { |
| 161 | 161 | $event = $this->createEvent($operationMetadata, EventType::CONNECTED); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | private function getStreamContextFromMetaData($meta) |
| 107 | 107 | { |
| 108 | - $metaStreamContext = $meta[ RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT ]; |
|
| 108 | + $metaStreamContext = $meta[RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT]; |
|
| 109 | 109 | if (is_resource($metaStreamContext)) { |
| 110 | 110 | return $metaStreamContext; |
| 111 | 111 | } elseif (is_array($metaStreamContext)) { |
| 112 | 112 | return stream_context_create( |
| 113 | - isset($metaStreamContext[ 'options' ]) ? $metaStreamContext[ 'options' ] : [ ], |
|
| 114 | - isset($metaStreamContext[ 'params' ]) ? $metaStreamContext[ 'params' ] : [ ] |
|
| 113 | + isset($metaStreamContext['options']) ? $metaStreamContext['options'] : [], |
|
| 114 | + isset($metaStreamContext['params']) ? $metaStreamContext['params'] : [] |
|
| 115 | 115 | ); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $this->setSocketOperationTime($item, RequestExecutorInterface::META_CONNECTION_START_TIME); |
| 139 | 139 | |
| 140 | 140 | $socket->open( |
| 141 | - $meta[ RequestExecutorInterface::META_ADDRESS ], |
|
| 141 | + $meta[RequestExecutorInterface::META_ADDRESS], |
|
| 142 | 142 | $this->getStreamContextFromMetaData($meta) |
| 143 | 143 | ); |
| 144 | 144 | |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\RequestExecutor\Pipeline; |
| 11 | 11 | |
| 12 | 12 | use AsyncSockets\Event\EventType; |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | return ($desiredTimeout !== RequestExecutorInterface::WAIT_FOREVER) && |
| 59 | 59 | ( |
| 60 | - ($hasConnected && $lastOperationTime !== null) || |
|
| 60 | + ($hasConnected && $lastOperationTime !== null) || |
|
| 61 | 61 | !$hasConnected |
| 62 | - ) && |
|
| 62 | + ) && |
|
| 63 | 63 | ($microTime - $lastOperationTime >= $desiredTimeout) |
| 64 | - ; |
|
| 64 | + ; |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function processStage(array $operations) |
| 25 | 25 | { |
| 26 | 26 | /** @var OperationMetadata[] $operations */ |
| 27 | - $result = [ ]; |
|
| 27 | + $result = []; |
|
| 28 | 28 | $microTime = microtime(true); |
| 29 | 29 | foreach ($operations as $key => $operation) { |
| 30 | 30 | if ($this->isSingleSocketTimeout($operation, $microTime)) { |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | $meta[RequestExecutorInterface::META_USER_CONTEXT], |
| 54 | 54 | $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null && |
| 55 | 55 | !($descriptor->getSocket() instanceof ServerSocket) ? |
| 56 | - TimeoutEvent::DURING_IO : |
|
| 57 | - TimeoutEvent::DURING_CONNECTION |
|
| 56 | + TimeoutEvent::DURING_IO : TimeoutEvent::DURING_CONNECTION |
|
| 58 | 57 | ); |
| 59 | 58 | try { |
| 60 | 59 | $this->callSocketSubscribers($descriptor, $event); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Async sockets |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | - * |
|
| 7 | - * This source file is subject to the MIT license that is bundled |
|
| 8 | - * with this source code in the file LICENSE. |
|
| 9 | - */ |
|
| 3 | + * Async sockets |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]> |
|
| 6 | + * |
|
| 7 | + * This source file is subject to the MIT license that is bundled |
|
| 8 | + * with this source code in the file LICENSE. |
|
| 9 | + */ |
|
| 10 | 10 | namespace AsyncSockets\Exception; |
| 11 | 11 | |
| 12 | 12 | /** |