More About RPG iSockets

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

In the last issue, I introduced you to the iSockets library, which is already being used by nearly 1,000 people. This article picks up where that one left off.

For this installment, let's review the list of the available interfaces and their descriptions. The first part of the list below contains the primary iSockets subprocedures. They are what get called in a typical program when connecting to FedEx, UPS, DHL, Google, etc. The tools and helper functions are simply exposed interfaces that the primary subprocedures use to get their job done. For example, when you receive data using RecvURLData, that can be automatically converted to the desired character set (CCSID). The RecvURLData function calls OpenCvtCCSID, CvtCCSID, and CloseCVTCCSID to do that conversion. You have access to these functions for your own applications. And those applications do not need to be iSockets-oriented. In other words, if you have a CGI program and need to convert between CCSIDs, you can simply call these functions in iSockets to accomplish that goal. Another more general example is the Joblog() function. As long as you specify BNDDIR('ISOCKETS/ISOCKETS') for your binding directory, Joblog() and any of the other iSockets routines are available to you.

iSockets Interfaces
iSockets Subprocedures
Description
OpenURL
Start an iSockets connection to a remote location (Web server).
SendURLData
Send raw data to the remote location.
SendURLText
Send plain text to the remote location.
RecvURLData
Receive the response back from the remote location.
GetURLData
Combine send and receive from a Web server or Web services routine (helper function).
CloseURL
Close the open URL connection.
Tools and Other Helper Functions

encodeURL
Encode an entire URL.
encodeURLComponent
Encode a component of a URL.
escapeURI
Encode URLs but accept a list of "do not encode" characters (low-level interface).
OpenCvtCSSID
Open a conversion environment using iconv().
CvtCCSID
Convert a value to the target CCSID.
CloseCvtCCSID
Close the conversion environment.
Joblog
Write a line of text to the joblog.
Obfuscate
Convert text to ✏ format.
iSocketsCRLF
Translate to X'25' and to X'0D'.
iSocketsOptions
Change iSockets settings.
ISOCKETS_OPTIONS
Directly access iSockets settings through exported data structure.
iSocketsVer
Retrieve/log the installed iSockets version and build information.
CvtToASCII
Easily convert from the job's CCSID to IFS ASCII (helper function).
CvtFromASCII
Easily convert from IFS ASCII to the job's CCSID (helper function).

To download iSockets for free, visit the iSocket's Web page.

Bob Cozzi is a programmer/consultant, writer/author, and software developer of the RPG xTools, a popular add-on subprocedure library for RPG IV. His book The Modern RPG Language has been the most widely used RPG programming book for nearly two decades. He, along with others, speaks at and runs the highly-popular RPG World conference for RPG programmers.

BLOG COMMENTS POWERED BY DISQUS