chobie / php-uv

libuv php extension
184 stars 21 forks source link

https support #17

Open superjimpupcake opened 12 years ago

superjimpupcake commented 12 years ago

Hi, Is there anyway that php-uv can support ssl in a non-blocking fashion? In my framework, I used stream_socket_server, like the following: stream_context_set_option($context, 'ssl', 'local_cert', $certificate); stream_context_set_option($context, 'ssl', 'verify_peer', false); $server = stream_socket_server("$protocol://$ip:$port", $errno,$errstr,STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context); The ssl part works but seems like it is blocking, I tried to make it non-blocking by doing: stream_set_blocking($server, 0); Things stop working. Are there any ways that php-uv can help make serving ssl in an async fashion? Thanks. Best Regards, Jim

chobie commented 12 years ago

Hi Jim. currently, uv_tcp_init and uv_udp_init does not support SSL as far as I known.

I guess uv_fs_poll_start could be handle stream server resource. but I didn't try yet. https://github.com/chobie/php-uv#uv-uv_fs_poll_startresource-handle-callback-string-path-long-interval

I'll plan to support SSL socket. but I haven't try SSL programming yet. so this will take little bit long time.