ivanatora has asked for the wisdom of the Perl Monks concerning the following question:
makes the socket non-blocking, but a friend of mine just laughed and said that I'm wrong :) He said that I better use Fcntl, but it still could be done with IO::Socket... I'm confused.$sock->autoflush(1); $| = 1;
So in that way I make simple query-response bots, but nothing more than that.IO::Socket -> create the socket $sock->autoflush(1); $| = 1; while (<$sock> ){ if ($sock =~ /some stuff/){ do(some other stuff); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: About non-blocking sockets
by Transient (Hermit) on Aug 18, 2005 at 16:23 UTC | |
by ivanatora (Sexton) on Aug 18, 2005 at 16:35 UTC | |
by Ven'Tatsu (Deacon) on Aug 18, 2005 at 17:09 UTC | |
by ivanatora (Sexton) on Aug 18, 2005 at 21:26 UTC | |
by Ven'Tatsu (Deacon) on Aug 19, 2005 at 13:28 UTC | |
Re: About non-blocking sockets
by johnnywang (Priest) on Aug 18, 2005 at 17:27 UTC | |
Re: About non-blocking sockets
by zentara (Cardinal) on Aug 18, 2005 at 20:50 UTC |