How to see a timeout in connect/send in AS/400?

352395 pts.
Tags:
AS/400
Java
RPG
My team and I recently created a socket client in RPG that calls a Java server socket. However, the problem that we're running into is that connect()/sent() operations blocks and we have a requirement that if the connect/send couldn't be done in a matter of a second per say, we have to just log it and finish.

We're having trouble on how to proceed with this. Could someone help us with the next steps. Thanks!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Use the setsockopt and SO_RCVTIMEO variables in RPG to control the timeout for a socket connection.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    There are a number of possibilities. You mention "connect()/sen[d]() operations", but those are two very different things. A timeout on connect() is not the same as on send() and ought to be treated differently. For example, creating connections can have additional considerations such as a few (or even 'many') extra seconds just to have the system do necessary DNS resolutions and other things.

    I suggest that you download the Socket Programming manual (.PDF) and use it for various searches on the term [ timeout ]. You can search the appropriate Information Center for your OS release, but searching the .PDF might be easier for you.

    After reading a few related topic references, you'll need to post a couple sections of your source code to show where your timeouts need to be handled. And please add a basic description of what you want your programming to do at that point.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following