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

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:
[1]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

References

   1. 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
-----------------------------------------------------------------------