1 | <?php |
||
25 | class SslDataFlushEventHandler implements EventHandlerInterface |
||
26 | { |
||
27 | /** |
||
28 | * Next handler |
||
29 | * |
||
30 | * @var EventHandlerInterface|null |
||
31 | */ |
||
32 | private $next; |
||
33 | |||
34 | /** |
||
35 | * Array of socket descriptors currently in flush |
||
36 | * |
||
37 | * @var bool[] |
||
38 | */ |
||
39 | private $inFlushingOperations = []; |
||
40 | |||
41 | /** |
||
42 | * SslDataFlushEventHandler constructor. |
||
43 | * |
||
44 | * @param EventHandlerInterface|null $next Next event handler |
||
45 | */ |
||
46 | 7 | public function __construct(EventHandlerInterface $next = null) |
|
50 | |||
51 | /** {@inheritdoc} */ |
||
52 | 7 | public function invokeEvent( |
|
71 | |||
72 | /** |
||
73 | * Handle first data alert and try to flush ssl data by empty frame |
||
74 | * |
||
75 | * @param DataAlertEvent $event Event object |
||
76 | * @param RequestExecutorInterface $executor Request executor fired an event |
||
77 | * @param SocketInterface $socket Socket connected with event |
||
78 | * @param ExecutionContext $context Global data context |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | 1 | private function onDataAlert( |
|
102 | |||
103 | /** |
||
104 | * Handle read data |
||
105 | * |
||
106 | * @param ReadEvent $event Read event |
||
107 | * @param RequestExecutorInterface $executor Request executor fired an event |
||
108 | * @param SocketInterface $socket Socket connected with event |
||
109 | * @param ExecutionContext $context Global data context |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | 1 | private function onRead( |
|
128 | |||
129 | /** |
||
130 | * Call next event handler |
||
131 | * |
||
132 | * @param Event $event Event object |
||
133 | * @param RequestExecutorInterface $executor Request executor fired an event |
||
134 | * @param SocketInterface $socket Socket connected with event |
||
135 | * @param ExecutionContext $context Global data context |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | 6 | private function callNextHandler( |
|
149 | } |
||
150 |