Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TheTechsTech opened this issue Jan 14, 2020 · 3 comments
Closed

Comments

@TheTechsTech
Copy link

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
@TheTechsTech TheTechsTech changed the title It seems anything relate to network writes on Windows not working. Stream writing with uv_write and uv_fs_write on Windows not working. Jan 15, 2020
@bwoebi
Copy link
Member

bwoebi commented Feb 15, 2020

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
Copy link
Member

bwoebi commented Feb 15, 2020

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

TheTechsTech added a commit to TheTechsTech/php-uv that referenced this issue May 1, 2020
TheTechsTech added a commit to symplely/uv-ffi that referenced this issue Aug 3, 2022
…t-uv

- added back `ext-uv` C source code until all functions within is implemented.
- added functions/methods for direct Zval handling, a rewrite from https://github.com/lisachenko/z-engine.
- updated each platform `libuv` cdef *.h header files, currently only Windows version is used for implementation at the moment.
- added `zend api` *.h headers.
- additional tests implemented.
- updated examples to use ffi version by adding `require 'vendor/autoload.php';`
- updated CI to build/use libuv 1.44.2.
- additional stubs/updates for IDE static analysis.
- update Readme sections and progress.
- discovered `ext-uv` issue amphp/ext-uv#78 not really a real issue. The tests and examples using old `libuv` version that does not do a conversion on Windows from '0.0.0.0', changing to '127.0.0.1' everything works.
- also `uv_tty_init($loop, STDOUT,0)` can be used instead for `uv_pipe_open($loop, STDOUT)` that does not work on Windows and according to libuv/help#120 it's the best solution.
- added an emulation mode for `uv_pipe_open($loop, STDOUT)` under Windows, by using `uv_pipe()` internally.
- Todo: address amphp/ext-uv#82 and amphp/ext-uv#45
@TheTechsTech
Copy link
Author

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.

TheTechsTech added a commit to TheTechsTech/php-uv that referenced this issue Sep 23, 2022
- corrections in reference to amphp#78
- `uv_tcp_getsockname` returning ip4 for ip6 address, reason `uv_inet_ntop()` has `AF_INET` not `AF_INET6`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants