PHP 8.5.0 Alpha 1 available for testing

Voting

: zero minus zero?
(Example: nine)

The Note You're Voting On

keksov[at]gmx.de
23 years ago
If you want to reuse address and port, and get rid of error: unable to bind, address already in use, you have to use socket_setopt (check actual spelling for this function in you PHP verison) before calling bind:

<?php
if (!socket_set_option($sock, SOL_SOCKET, SO_REUSEADDR, 1)) {
echo
socket_strerror(socket_last_error($sock));
exit;
}
?>

This solution was found by
Christophe Dirac. Thank you Christophe!

<< Back to user notes page

To Top