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

RE: Error using http_url_get



Hello Scott and Sean,
My version of  HTTPAPI is 1.23 released 2008-04-24 OS/400 Ver V6R1M0
Is It old?
I've activated the debug and I stressed the program:
http_debug(*on:'/PUMART/dbg_purtsrcpgm.txt');

When I go to launch the program and It goes wrong, this is not written to me debugging and it seemed very strange.

So I went out of program and I did wrklnk '/PUMA*' and I take this CPF:  
CPFA0A4  (Error CPFA0A4.Too many open files for process.)

At first on my session I've done wrkjob --> opz. 14 
But there isn't open file.
So I ask to google help me!
I've read a post with the same problem and i find the problem.
In a program I do the open on my ifs .txt but i didn't close, beacause I was used a return instead of a leave... 
So I saturate open files my job, inizially I was though that should be a socket problem because I was misled variable error msg that was enhanced with "() Socket: Too many open files".

Thank's to all availability.

Merry Christmas and Happy New Year

MC                                           
                                                                                



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: giovedì 19 dicembre 2013 00:13
To: HTTPAPI and FTPAPI Projects
Subject: Re: Error using http_url_get

Hello Matteo,

For some reason, you are getting an error when you try to create a socket.  A socket is a tool used to read/write data to a network. (A socket is similar to a file, except a file is for reading/writing data to a hard drive, and a socket is for reading/writing data to a program over a network.)

All error 4 means is that the system refused to create a socket.  To 
learn more about what has failed, please send us a debug/trace file.   
To do that, add http_debug(*on) into your code before you call any HTTPAPI routines. This will generate the trace file in an IFS file named 
/tmp/httpapi_debug.txt.   Please send a copy of that file to this 
mailing list -- it will tell us what error is occurring in opening a socket.

-SK


On 12/18/2013 2:14 AM, Ceriani Matteo wrote:
>     Hi Scott,
>
>
>
>     I try to use rc = http_url_get(URL: link); and it works well, but after
>     many time that I use it in interactive procedure, I obtain -1 return
>     value and using: http_error(err);
>
>     Err is value with "ERR = 4" and reading unix documentation I've
>     understood that should be a problem on the open socket... is there a
>     way to close then?
>
>     if i do on my system "ulimit -aH" i've for  unlimited    and if I do
>     "ulimit -aS" I've 200 for open file/item.
>
>     thk's in advance.
>
>     Matteo
>
>
>
>     my code:
>
>
>
>     http_debug(*off:'/PUMART/dbg.txt');
>
>              rc = http_url_get(URL: link);
>
>              if rc = 302;
>
>                 url = http_redir_loc;
>
>                 rc = http_url_get(URL: link);
>
>              endif;
>
>              if rc <> 1 ;
>
>                 http_error(err);
>
>                 if err <> HTTP_NDAUTH;
>
>                    http_debug(*on:'/PUMART/dbg.txt');
>
>                    msg = HTTP_ERROR;
>
>                    return *on;
>
>                 endif;
>
>                 rc = http_getauth(basic: digest: realm) ;
>
>                 if rc < 0;
>
>                    msg = HTTP_ERROR ;
>
>                    return *on;
>
>                 endif ;
>
>                 userid = 'xxx';
>
>                 pass = 'xxx' ;
>
>                 if  Digest   ;
>
>                     http_setauth(HTTP_AUTH_MD5_DIGEST:
>
>                                          userid: pass);
>
>                 else;
>
>                      http_setauth(HTTP_AUTH_BASIC:
>
>                                           userid: pass);
>
>                endif ;
>
>                rc = http_url_get(URL: link);
>
>                if rc = 302;
>
>                   url = http_redir_loc;
>
>                   rc = http_url_get(URL: link);
>
>                endif;
>
>                IF  rc <> 1;
>
>                    http_debug(*on:'/PUMART/dbg.txt');
>
>                    eval      msg = HTTP_ERROR;
>
>                    return *on;
>
>                endif;
>
>              endif;
>
>
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------