QSOSRV1 service program hangs on recv() procedure

15 pts.
Tags:
AS/400
RPGLE
Socket programming
My program hangs on IBM's service program QSOSRV1 when it runs the 'recv' procedure. It's hung at statement 9. This only happens occasionally. Most of the time the 'recv' procedure works fine. I'm new to sockets programming and would appreciate any help or suggestions. The 'recv' statement receives a weight from a scale and that weight is then displayed to the user via my RPGLE program.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.
IBM has a good, but lengthy PDF on socket programming you can find here IBM SOCKET PROGRAMMING
For further info I found this where there is supposedly a slight defect in the tutorial. The fix can be found here

Discuss This Question: 3  Replies

 
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.
  • ToddN2000
    Seeing as this only happens on occasion, are there any errors in the joblog? How is your scale sending the data to the system, it may be a network issue.
    124,340 pointsBadges:
    report
  • fhartman
    No errors at all in the joblog. I'm using Scott Klement's socket tutorial to create my RPGLE program. I'm sure my problem is that originally my socket was not created as "non blocking". I believe I have that corrected now and I'm trying to find an example of using the "select()" API with a timeout value in conjunction with the "recv()" API. I'm completely new to sockets programming and I'm lost. My program is 98% finished and I think if I could find an RPGLE of how "select()" and "recv()" work together I'd be all set.
    15 pointsBadges:
    report
  • TheRealRaven
    Since Scott's tutorial contains a complete example that uses select(), it's not clear what you need. Is there a problem with that example that we should address? Otherwise examples will look pretty much exactly like what you have.

    The recv() API will "hang" when there is no data to pull out of the socket, waiting until something arrives or an error is signaled. Is that not the behavior that you want?
    31,805 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.

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

Following

Share this item with your network: