@@ -95,22 +95,27 @@ class SecureServer extends EventEmitter implements ServerInterface
9595 * and/or PHP version.
9696 * Passing unknown context options has no effect.
9797 *
98- * Advanced usage: Internally, the `SecureServer` has to set the required
99- * context options on the underlying stream resources.
100- * It should therefor be used with an unmodified `Server` instance as first
101- * parameter so that it can allocate an empty context resource which this
102- * class uses to set required TLS context options.
103- * Failing to do so may result in some hard to trace race conditions,
104- * because all stream resources will use a single, shared default context
105- * resource otherwise.
98+ * Advanced usage: Despite allowing any `ServerInterface` as first parameter,
99+ * you SHOULD pass an unmodified `Server` instance as first parameter, unless you
100+ * know what you're doing.
101+ * Internally, the `SecureServer` has to set the required TLS context options on
102+ * the underlying stream resources.
103+ * These resources are not exposed through any of the interfaces defined in this
104+ * package, but only through the `React\Stream\Stream` class.
105+ * The unmodified `Server` class is guaranteed to emit connections that implement
106+ * the `ConnectionInterface` and also extend the `Stream` class in order to
107+ * expose these underlying resources.
108+ * If you use a custom `ServerInterface` and its `connection` event does not
109+ * meet this requirement, the `SecureServer` will emit an `error` event and
110+ * then close the underlying connection.
106111 *
107- * @param Server $tcp
112+ * @param ServerInterface| Server $tcp
108113 * @param LoopInterface $loop
109114 * @param array $context
110115 * @see Server
111116 * @link http://php.net/manual/en/context.ssl.php for TLS context options
112117 */
113- public function __construct (Server $ tcp , LoopInterface $ loop , array $ context )
118+ public function __construct (ServerInterface $ tcp , LoopInterface $ loop , array $ context )
114119 {
115120 // default to empty passphrase to surpress blocking passphrase prompt
116121 $ context += array (
0 commit comments