File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,13 @@ public function open() : Greeting
106
106
}
107
107
108
108
$ this ->stream = $ stream ;
109
- \stream_set_timeout ($ this ->stream , $ this ->options ['socket_timeout ' ]);
109
+ $ socketTimeoutMicroseconds = 0 ;
110
+ if (is_float ($ this ->options ['socket_timeout ' ])) {
111
+ $ socketTimeoutMicroseconds = (int )($ this ->options ['socket_timeout ' ] * 1000000 );
112
+ $ this ->options ['socket_timeout ' ] = (int )($ this ->options ['socket_timeout ' ]);
113
+ $ socketTimeoutMicroseconds -= $ this ->options ['socket_timeout ' ] * 1000000 ;
114
+ }
115
+ \stream_set_timeout ($ this ->stream , $ this ->options ['socket_timeout ' ], $ socketTimeoutMicroseconds );
110
116
111
117
if ($ this ->options ['persistent ' ] && \ftell ($ this ->stream )) {
112
118
return $ this ->greeting = Greeting::unknown ();
You can’t perform that action at this time.
0 commit comments