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

Re: HTTP server v. user written socket server




If I understand your question correctly, you're asking the following:


   I need to respond to an HTTP post request.  Should I use the HTTP
   server that IBM provides, or should I write my own HTTP server from
   the ground up?

The answer is: It depends. In most cases, I'd suggest using the "Powered By Apache" server that comes with OS/400. It's free, extremely versatile, mature, officially supported, and in very wide usage. (Apache accounts for something like 70% of the web servers on the Internet.)

The only reason I'd write my own is if Apache couldn't do something that you needed to do, or if you wanted to optimize it for a particular task and sell it as your own.

In any case, HTTPAPI won't help you write your own. HTTPAPI has nothing whatsoever to do with writing an HTTP server. HTTPAPI is for HTTP *CLIENT* programming only.

---
Scott Klement  http://www.scottklement.com

On Thu, 16 Mar 2006, Brian Doherty wrote:

Hello Scott etc,


I'm not sure this is the right place for this, but here goes

I have been working with the httpapi, cgidev2 and socket tutorial on and
off for a week or two in order to help me find the best approach to
delivering an application that I need to write.

I need to respond to http POST requests to provide some information, (and
sometimes send some http POST requests to receive information). This will
be application to application over a VPN. The data content of the POST is
bespoke unfortunately, but fairly easy for me to parse/build.

We don't use the HTTP server on our iSeries at all at the moment,other
than for me to test out the cgidev2 stuff!
I'm pretty ignorant of how the http server works. My only experience of it
is using CGIDEV2 recently. We are on OS/400 V5R3M0.

The way I see it is I have two ways to process received requests.

1.      Use the HTTP server on the iSeries and a cgi application that uses
the httpapi to process the request and send the response.
2.      Write my own socket server program and use the httpapi to process
the request and send the response.

I need the process to be as fast as possible.

My hunch is that option 1 will be easier to implement. I won’t have to
write the socket server, although I have created one from Scott’s socket
example SVREX7L/I as part of my investigation.

Option 2 might be more efficient if I keep the server instances active. I
suppose this depends on whether the client connection stays active.

Does anybody have any thoughts on the relative merits of using HTTP server
or a user written socket server?

Thanks

Brian Doherty

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