× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I agree with Charles. Why worry about trying to spawn socket servers and
close them yourself when the HTTP server can do all that for you. Just
use the web based tools at http://yoursystem:2001

The https become much more trivial that way as well.

Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi

Young i Professionals
http://www.youngiprofessionals.com



Charles Wilt <charles.wilt@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
03/11/2009 10:59 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Socket Server Application Approach






Gerald,

Do you really have to write the socket routines yourself?

Why not a simple web service? That way the HTTP server on the i would
handle the socket stuff for you. After all, you did say that the
application needed to connect via HTTPS.

If all you really need is an RPG web service, then basically you've
got a few choices.
--You could write an RPG-CGI program. There are various third party
tools to help, or there's the free CGIDEV2 from IBM, or you can use
the raw Unix APIs.
--WDSCi or other tools can be used to generate a web service wrapper
for RPG programs/procedures.
http://www.itjungle.com/fhg/fhg061808-story01.html and for example
http://www.rpg-xml.com/

Good place to start is the WEB400 mailing list archives here on
midrange.com.

HTH,
Charles


On Wed, Mar 11, 2009 at 11:25 AM, <GKern@xxxxxxxxxxxxxxxx> wrote:
I've finally made it to the end of Scott Klement's Socket tutorial (well
not quite, there's the UDP stuff at the very end).

I have a request to develop the back end code that will accept patient
payments over the internet. The web application is written in ASP.net
and
it will connect (using https) to an ILE RPG socket server. The web
application will be sending a pipe delimited string of data.

Since the web application could accept multiple payment requests
simultaneously, I have a few questions:

Would a socket spawning approach be a good fit for this application?
After
(re)reading the tutorial I came to the conclusion that it would be,
based
on the comment that should one job crash other jobs wouldn't be affected
(as could be the case using the select() approach).

And since this application would be accepting input over the internet
via
server instances, I'm wondering if the RdLine/WrLine (as shown in the
tutorial) is acceptable (as opposed to using GetLine & PutLine) from the
select() approach? Does it matter? I'm concerned that with either
approach
I may still need to be concerned that the entire string of data
(probably
not more than 2048 bytes) may not be received with one read - which
leads
to my next question:

Should the RdLine/GetLine occur in a loop to ensure the full contents of
the string are received? Or does specifying the (maximum) length of
RdLine
always return (up to) that number of bytes?

And finally, since the example SVREX7I does not use a "dow 1=1", I'm
coding my logic as follows:

1) Website connects to server instance, and passes data string to server
instance;
2) Server instance reads data via RdLine, does edits and returns result
string to website via WrLine;
3) Server instance ends.

At this point should the server instance job be allowed to end?

If for example, the results returned to the website indicate that the
data
string was incomplete or contained errors, should a subsequent retry (by
the user) occur and interact with the server instance that did the
initial
edit?

Or should I allow a new server instance to take control?

My guess is that I would want a new server instance each time since I
have
no guarantee that the user on the internet will, with certainty,
continue
the transaction to completion.

This is the direction I'm moving in. Comments welcome.

Thanks!

Regards, Jerry

Gerald Kern - MIS Project Leader
Lotus Notes/Domino Administrator
IBM Certified RPG IV Developer
The Toledo Clinic, Inc.
4235 Secor Road
Toledo, OH 43623-4299
Phone 419-479-5535
gkern@xxxxxxxxxxxxxxxx


This e-mail message, including any attachments, is for the sole use of
the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please inform the
sender by reply e-mail and destroy this and all copies of this message.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.