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



Folks:

I recently ran into a rather perplexing problem with a program that was
submitted to the iSeries through the Client Access remote command facility
(executing from a Java program on the PC), and I thought I'd share what was
discovered.

We have a program that can operate in one of two modes ... one mode does
straight DB2 updates through RPG programs (OPM no less).  The other mode
updates a remote server through a custom protocol via TCP/IP (direct
sockets) through ILE RPG programs.

When we ran the program with the direct database update mode, it worked
fine.  However, when we ran it in remote server update mode, it caused the
remote command job (QZSCSRVS) to fail with a buffer error.

I banged my head against the wall trying to figure out what was going
wrong... went down a bunch of false leads.

Finally got IBM support involved.  They looked at job logs, ran some LIC
traces, and finally determined that somehow socket 0 was being closed.

Well, it turns out that our program was closing socket zero.

Because our remote server will disconnect if there is no activity for a
certain period of time, we have code that allows for reconnect... but before
we try to connect (even the first time) we close the currently open socket.
When we didn't open the socket, we close socket 0.  Socket 0, unfortunately,
didn't belong to us.  It belonged to the remote command job.

Solution was to init our programs socket variable to -1 so we can detect if
we've opened it or not.

It was a long and frustrating problem, but the final result was 3 lines of
changed code.

david






As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.