Re: [PATCH 2/3] git-instaweb: Wait for server to start before running web browser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It uses IO::Socket::INET module, which is core Perl module since v5.6.0.

Core module means it will be installed by default in v5.6. But what
happens in case of lower versions of perl ?

> +httpd_is_ready () {
> +       "$PERL" -MIO::Socket::INET -e "
> +local \$| = 1; # turn on autoflush
> +exit if (IO::Socket::INET->new('127.0.0.1:$port'));
> +print 'Waiting for \'$httpd\' to start ..';
> +do {
> +       print '.';
> +       sleep(1);
> +} until (IO::Socket::INET->new('127.0.0.1:$port'));
> +print qq! (done)\n!;
> +"
> +}
> +

One of the solution is to add a web server specific branch in httpd_is_ready().
So, if the server is plackup it loads the module and checks the port,
if not it will just continue.

Just an Idea for a common usage.

Thanks,
Pavan.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]