Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

IO::Socket, or any IO

Visto 29 veces
Saltar al primer mensaje no leído

Michael Snoyman

no leída,
24 ago 2006, 12:54:2124/8/06
a perl6...@perl.org
I was thinking of rewriting a little webserver program I wrote in Perl 5
using Pugs. I was wondering what the equivilent (if any) of IO::Socket is.
I suppose I could use an external webserver and use CGI to get this working
with IO, but my preference would be a pure Perl 6 approach.

If you're wondering, the program I wrote is a simple little webpage with two
buttons so my wife can play music off my Linux box (with good speakers) from
her laptop (with bad speakers), so I don't really need this to be a very
stable setup, it's mostly for curiosity's sake.

Michael

Audrey Tang

no leída,
8 sept 2006, 5:41:148/9/06
a Michael Snoyman,perl6...@perl.org

在 Aug 25, 2006 12:54 AM 時,Michael Snoyman 寫到:

> I was thinking of rewriting a little webserver program I wrote in
> Perl 5
> using Pugs. I was wondering what the equivilent (if any) of
> IO::Socket is.
> I suppose I could use an external webserver and use CGI to get this
> working
> with IO, but my preference would be a pure Perl 6 approach.

See examples/network/http-server.pl in the Pugs tree. :-)

Cheers,
Audrey

Michael Snoyman

no leída,
8 sept 2006, 10:33:238/9/06
a Audrey Tang,perl6...@perl.org
Thanks Audrey. I actually found that after writing that post. What I had
wanted to do was write a threaded server, implemented in Perl 6 only (ie,
including Perl 6 regexs). I got that working almost entirely, when I
couldn't find any thread implementation. I tried using fork() to get a same
effect, but it seems that fork also isn't available. Was I missing
something, or are these just features that I need to wait for?

Thanks,
Michael

Audrey Tang

no leída,
9 sept 2006, 7:21:139/9/06
a Michael Snoyman,perl6...@perl.org

在 Sep 8, 2006 10:33 PM 時,Michael Snoyman 寫到:

> Thanks Audrey. I actually found that after writing that post.
> What I had wanted to do was write a threaded server, implemented in
> Perl 6 only (ie, including Perl 6 regexs). I got that working
> almost entirely, when I couldn't find any thread implementation. I
> tried using fork() to get a same effect, but it seems that fork
> also isn't available. Was I missing something, or are these just
> features that I need to wait for?

async{} creates a thread:

my $thr = async { ... };

You can use the usual .join, .detach, .yield methods on it.

Thanks,
Audrey


0 mensajes nuevos