amphp / ext-uv

Other
191 stars 28 forks source link

Stream writing with uv_write and uv_fs_write on Windows not working. #78

Closed TheTechsTech closed 2 years ago

TheTechsTech commented 4 years ago

The tcp_bind.php example waits for connect instead doing an auto client connect, i manually connect and get header dump

string(335) "GET / HTTP/1.1
Host: localhost:9999
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1

The poll.php example accepts connect, no display in browser, and errors with

PHP Warning:  fclose() expects parameter 1 to be resource, boolean in ...\php-uv\examples\poll.php on line 31

The pipe.php example

PHP Warning:  uv_pipe_open(): invalid argument in ...\php-uv\examples\pipe.php on line 4
and 
PHP Warning:  uv_write(): write failed in ...\php-uv\examples\pipe.php on line 11

The pipe_bind_connect.php example

PHP Warning:  uv_pipe_bind(): permission denied in ...\php-uv\examples\pipe_bind_connect.php on line 5
and 
PHP Warning:  uv_write(): write failed in ...\php-uv\examples\pipe_bind_connect.php on line 23
bwoebi commented 4 years ago

I do not know yet why listening does not work, though now $conn will always be available with poll.php, i.e. the fclose() error should not appear with current master.

bwoebi commented 4 years ago

The pipes are failing because windows just does not support named pipes like that, it needs something arcane like \\pipe\TheName.

TheTechsTech commented 2 years ago

My WIP uv-ffi uses current libuv version that has a uv_pipe() function, so uv_pipe_open($loop, STDOUT); has a additional emulation mode gets switch to whenever called, getting the same behavior.