Bob Cozzi wrote:
There's an old saying "If it ain't broke, don't fix it" I've always felt that was said by a jacka$$. The saying that I like is:
"If it ain't broke, you ain't looked hard enough!"
What's wrong with the wheel?
Well, there's too much excess rubber, recycling isn't at 100% yet, it goes
flat, even in 2004, and on and on.
Why reinvent it? To solve these and many other problems that are overlooked
simply because we're used to them.
Building a webserver will give whoever does it, the pleasure of learning
more about the way things work in programs such as Apache (for example) than
most of us will learn in our lifetimes out it. Thus that person may choose
to share that knowledge with others; and there's always the possibility that
they could improve existing technology through the discovery process.
I think it's a great idea.
-Bob Cozzi



Well I'm sure the great Canadian philosopher Red Green once said "If it ain't broke, you're not trying hard enough". But I'm sure he wasn't the first to make that observation.


I don't want to discourage anyone from trying to develop a new HTTP server, but as others have pointed out, it's already been done. And the whole WWW benefits from the existing servers, especially the open-source Apache.

Fact is, there are lots of ways to implement HTTP servers. Using Python, it's possible to implement an HTTP server in as few as 3 lines of code. (I know - I've done it myself! You basically just instantiate a CGIHTTPServer object.)

But an HTTP server in RPG? Well, one bottleneck you'll likely run into is the fact that RPG has limitations running in a threaded environment. RPG programs are generally non-reentrant. The best you can do is code the THREAD(*SERIALIZE) option which ensures that a module is active in only one thread at one time. Threading is normally needed in a server program to give speedy response to each request.

I've argued this point before, but if you want to do systems programming, you're way better off using a language that's better suited to systems programming, like C. RPG is best suited to applications programming, which has entirely different needs. The fact that you *can* do calls to system API's in RPG doesn't mean you *should* call them from RPG!

By all means, don't shy away from implementing your own HTTP server. But IMHO, you'll learn more about the HTTP by coding it in C. If you want to learn more about RPG programming, then choose a problem in the application programming domain.

Cheers! Hans


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.