|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-03 10:24 UTC] heruan at aldu dot net
[2014-04-03 10:58 UTC] heruan at aldu dot net
[2022-08-05 21:08 UTC] bukka@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: bukka
[2022-08-05 21:08 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ When using stream_socket_server with non blocking stream, there seems to have no way to write buffer to client. When the stream is in blocking mode, things start working again. Test script: --------------- <?php $protocol = "ssl"; $ip = "127.0.0.1"; $port = 8000; $context = stream_context_create(); $certificate = __DIR__."/certificate_concat.pem"; 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); stream_set_blocking($server, 0); //when set to non blocking, ssl will not work, if set to blocking, things start working again while(true) { $client = stream_socket_accept($server); print "accepted " . stream_socket_get_name( $client, true) . "\n"; if( $client ) { fwrite($client, "hello"); } else { print "error.\n"; } }