I am programming in ILE Cobol and want to use IP Socket to communicate with an application on a Linux server. However, I cannot get the content of the C++ variable 'errno' returned back into the Cobol program. I have declared 'errno' as external, 'call procedure' the sockets functions and have bound the whole lot with the QSYS/QSOSRV1 sockets service program, but it does not work.
The declaration of errno follows:
01 errno pic s9(09) binary external.
An example of the call follows:
Call procedure "bind" using by value
returning into socket-error
The 'Socket' AND 'Setsockopt' functions work and returns the socket descriptor, etc. The 'Bind' does not work and I do not know how to trace the problem but through 'errno'.
Any help will be appreciated.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!