@@ -135,16 +135,46 @@ public function unsetAuth()
135135 $ this ->auth = null ;
136136 }
137137
138+ /**
139+ * Creates a SecureConnector instance that can be used to establish encrypted TLS connections to remote hosts.
140+ *
141+ * This is actually a convenience helper method that uses React's normal
142+ * `SecureConnector` wrapper and this libraries' `Connector` for the
143+ * underlying TCP connection.
144+ *
145+ * @return SecureConnector
146+ * @uses self::createConnector()
147+ */
138148 public function createSecureConnector ()
139149 {
140150 return new SecureConnector ($ this ->createConnector (), $ this ->loop );
141151 }
142152
153+ /**
154+ * Creates a Connector instance that can be used to establish TCP connections to remote hosts.
155+ *
156+ * This return a new `Connector` instance which can then be used to establish
157+ * any number of TCP connections.
158+ *
159+ * @return Connector
160+ * @see Connector
161+ */
143162 public function createConnector ()
144163 {
145164 return new Connector ($ this );
146165 }
147166
167+ /**
168+ * Should not be called directly, use createConnector() instead.
169+ *
170+ * This method contains the internal implementation for estasblishing a
171+ * connection to the SOCKS server.
172+ *
173+ * @param string $host
174+ * @param int $port
175+ * @return Promise Promise<Stream,Exception>
176+ * @internal use self::createConnector() instead
177+ */
148178 public function getConnection ($ host , $ port )
149179 {
150180 if (strlen ($ host ) > 255 || $ port > 65535 || $ port < 0 ) {
@@ -214,6 +244,17 @@ private function resolve($host)
214244 return $ this ->resolver ->resolve ($ host );
215245 }
216246
247+ /**
248+ * Internal helper used to handle the communication with the SOCKS server
249+ *
250+ * @param Stream $stream
251+ * @param string $host
252+ * @param int $port
253+ * @param float $timeout
254+ * @param string $protocolVersion
255+ * @param string|null $auth
256+ * @return Promise Promise<stream, Exception>
257+ */
217258 public function handleConnectedSocks (Stream $ stream , $ host , $ port , $ timeout , $ protocolVersion , $ auth =null )
218259 {
219260 $ deferred = new Deferred ();
0 commit comments