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

Re: HTTPAPI (fwd)



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Hi Rick,

> I have a file that I would like to read a record, take that record send
> to a web service, take response data and update a file.  I have a CL
> program reading records from file and calling RPGLE program to do the
> actual post of the data.

I think I may have asked this before, but why not just read the file in
the RPG program?


> In the called RPGLE program I am doing the https_init,
> http_url_post_raw. The "problem" I see is it opens a new port for every
> call to the program. This uses up resources rather quickly and
> eventually gives me an error after several hundred records.

Hmmm..  I'd like to experiment with this myself.  Is that permissible?
Or, is there a way that I can test this situation myself?

The use of a separate port for each TCP connection is normal -- it's the
way TCP/IP works. If you're submitting many such connections rapidly, it
will be resource intensive.

That's why persistent HTTP was created.  In a persistent scenario, you
connect once and submit many requests, one after the other.

In version 1.9 of HTTPAPI, you could perform persistent connections by
calling the lower level functions, http_parseURL(), https_connect(),
https_postraw() (many times), https_close().

As far as I know, NOBODY ever used these routines -- they were too
low-level, too awkward to use.  so, they've been removed from version
1.10 -- since it simplified the modularization of the API.

We could split the routines back out -- though I think I'd do it a little
bit differently this time so that it's not as awkward to use, and so that
it works with the new CommTCP & CommSSL modules.

That is, assuming that it would solve the problem?

I think it's a bit weird that the server makes you submit each record
separately instead of accepting many records in a single POST.  That would
sure be more efficient.


> Has anyone else used the HTTPAPI in this fashion?  If so, can you give
> me a general idea of how this scenario needs to be handled.  I have
> posted questions related to this before but still not sure how this
> should be handled.

Nope, haven't had the need to do this.  If you can tell me how to
reproduce the problem, I'll put it on my "to-do" list.  (Which,
unfortunately, is very long right about now.)

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------