Open michaellenahan opened 7 years ago
Just tried locally and it works fine for me. Does it happen every time? I seem to recall there being some race conditions after opening the socket. Maybe you can try increasing https://github.com/php-school/learn-you-php/blob/master/src/Exercise/TimeServer.php#L78 to see if it fixes? Other than that I'm not really sure :/
We can definitely improve the experience by catching the exception and give a nicer error message. We could also retry on a different port if it fails the first time.
Thanks for responding!
"Does it happen every time?" Yes. I haven't tried it on another machine yet, I guess it must be something locally.
I have increased https://github.com/php-school/learn-you-php/blob/master/src/Exercise/TimeServer.php#L78 to 1000000, but that did not help.
On the time-server exercise, I get the following error when running:
time.php is the solution code from here: https://raw.githubusercontent.com/php-school/learn-you-php/master/exercises/time-server/solution/solution.php