File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1173,21 +1173,20 @@ private function sendHandshake($inSSL = false) {
1173
1173
$ payload .= str_repeat ("\0" , 23 ); // reserved
1174
1174
1175
1175
if (!$ inSSL && ($ this ->capabilities & self ::CLIENT_SSL )) {
1176
- \Amp \call (function () use ($ payload ) {
1177
- yield $ this ->write ($ payload );
1176
+ \Amp \asyncCall (function () use ($ payload ) {
1177
+ try {
1178
+ yield $ this ->write ($ payload );
1178
1179
1179
- $ context = $ this ->config ->ssl ?: new ClientTlsContext ;
1180
- $ context = $ context ->withPeerName ($ this ->config ->host );
1180
+ $ context = $ this ->config ->ssl ?: new ClientTlsContext ;
1181
+ $ context = $ context ->withPeerName ($ this ->config ->host );
1181
1182
1182
- return yield $ this ->socket ->enableCrypto ($ context );
1183
- })->onResolve (function ($ error ) {
1184
- if ($ error ) {
1183
+ yield $ this ->socket ->enableCrypto ($ context );
1184
+
1185
+ $ this ->sendHandshake (true );
1186
+ } catch (\Throwable $ e ) {
1185
1187
$ this ->closeSocket ();
1186
- $ this ->getDeferred ()->fail ($ error );
1187
- return ;
1188
+ $ this ->getDeferred ()->fail ($ e );
1188
1189
}
1189
-
1190
- $ this ->sendHandshake (true );
1191
1190
});
1192
1191
1193
1192
return ;
You can’t perform that action at this time.
0 commit comments