Weird error lessage from fcntl: please help 
Author Message
 Weird error lessage from fcntl: please help

I am using the perl IO and Fcntl modules.

I have a program with the following code snippet [error checks removed]:

   $fh = IO::Socket::INET->new(PeerPort => $::cfg{"host_command_port"},
                                   Proto => 'tcp',
                                   PeerAddr => $agent_hostname);
    $status = fcntl($fh, &F_SETFL, &O_NONBLOCK);    # make handle non-blocking
    print "Fcntl ret: $status\n";

When I run it I get the following weird message:

Argument "zurich" isn't numeric in entersub at
/usr/local/lib/perl5/Fcntl.pm line 50.  

[zurich is the $agent_hostname in the first line].  This line
is followed by the result of my print line:

Fcntl ret: 0 but true

[which seems OK].

All I'm trying to do is make the socket non-blocking, so that if I read it
and nothing's there, I won't get blocked.  I think the fcntl call is
working, but I'm disturbed by the warning/error message.  Can anyone explain
what's going on and what to do about it?  Thanks in advance....

--

SRI Consulting                  Phone: 415.859.4300
333 Ravenswood Ave  AH301       Pager: 415.907.4598
Menlo Park CA 94025             FAX:   415.859.2986



Sat, 05 Jun 1999 03:00:00 GMT  
 Weird error lessage from fcntl: please help

|> I am using the perl IO and Fcntl modules.
|>
|> I have a program with the following code snippet [error checks removed]:
|>
|>    $fh = IO::Socket::INET->new(PeerPort => $::cfg{"host_command_port"},
|>                              Proto => 'tcp',
|>                              PeerAddr => $agent_hostname);
|>     $status = fcntl($fh, &F_SETFL, &O_NONBLOCK);    # make handle non-blocking
|>     print "Fcntl ret: $status\n";
|>
|> When I run it I get the following weird message:
|>
|>
|> Argument "zurich" isn't numeric in entersub at
|> /usr/local/lib/perl5/Fcntl.pm line 50.  
|>
|> [zurich is the $agent_hostname in the first line].  This line
|> is followed by the result of my print line:
|>
|> Fcntl ret: 0 but true
|>
|> [which seems OK].
|>
|> All I'm trying to do is make the socket non-blocking, so that if I read it
|> and nothing's there, I won't get blocked.  I think the fcntl call is
|> working, but I'm disturbed by the warning/error message.  Can anyone explain
|> what's going on and what to do about it?  Thanks in advance....
|>
|> --

|> SRI Consulting                  Phone: 415.859.4300
|> 333 Ravenswood Ave  AH301       Pager: 415.907.4598
|> Menlo Park CA 94025             FAX:   415.859.2986

I've seen this type of error when using "&" on the socket/fcntl/...
constants, although I can't test your code here.  Try

    $status = fcntl($fh, F_SETFL, O_NONBLOCK);    # make handle non-blocking

and see what happens.

-- Mark Allman

-- "Retreat is _not_ an option."



Sat, 05 Jun 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Please explain this weird error message

2. Please help with fcntl problem...

3. Please help with this script! Weird problem

4. Can anyone help with weird error?

5. HELP! Weird numeric errors

6. Compiler Failure -- Weird Compilation Errors (Re-Post because of MS software error)

7. Piddly runtime error using DB_File and Fcntl

8. Oracle DBD Error -- PLEASE Help

9. Please help - errors using Time?

10. PLEASE HELP: Error in IO::SOCKET when using NET::FTP

11. frustrating user error - help please

12. Strange error - PLEASE HELP

 

 
Powered by phpBB® Forum Software