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.

BOB COZZI

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.


MC Press books written by Robert Cozzi available now on the MC Press Bookstore.

RPG TnT RPG TnT
Get this jam-packed resource of quick, easy-to-implement RPG tips!
List Price $65.00

Now On Sale

The Modern RPG IV Language The Modern RPG IV Language
Cozzi on everything RPG! What more could you want?
List Price $99.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: