gawk's inet hanging?

View: New views
1 Messages — Rating Filter:   Alert me  

gawk's inet hanging?

by Jeff Chua :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying put gawk inet connection to the local smtp port and would like it
to detect error conditions, but don't know how.

Here's the code ...

awk '
        BEGIN {
                GAWK_SOCK_RETRIES = 2;  # this doesn't seem to do anything
                serv = "/inet/tcp/0/localhost/25";
                print "help" |& serv;
       }
'


It works when sendmail is running. But when I stop sendmail, running the
above code just hangs without reporting any error. Running "telnet localhost
25" returns error right away.

Thanks,
Jeff