Comment, asking:
> Like what? Have you ever tried to write a TCP server in REXX?
Comment, receiving:
> Start here and it is reasonably simple:
- TCPIP.SEZAINST(RSSERVER)
- TCPIP.SEZAINST(R6SERVER)
Comment: so writing a TCP server in REXX is not only theoretically possible, but a reality.
Interesting what happens next:
Thanks for the links. Now, there is code duplication between the two
modules. How would one go
about externalizing the common code to a module?
The method of maintaining the socket descriptor list is crude and
highlights the lack of data
structures in classic REXX.
Writing a non-blocking, multiplexing TCP server in Python is simple
https://docs.python.org/3/library/selectors.html
Comment: surprisingly bringing up totally different items/aspects (somehow as "if you can,
confuse/sidetrack/derail them"). The answer is: if one has a need for a TCP server or a TCP client
in REXX one can create and use one as has been pointed out.
There have been no questions asked about how to go about "writing a non-blocking, mulitplexing TCP
server in Python". If there was a need to "write a non-blocking, multiplexing TCP server in Python"
why was that particular question not asked in the first place?
OTOH if the need is for REXX servers and/or clients (the original question) that employ "a
non-blocking, mulitplexing TCP server" (the new, derailing questions) and one wishes to code that in
REXX one can either look for REXX function libraries supplying the needed infrastructure, or create
such interfaces to such libraries, or use NetRexx or BSF4ooRexx, which get one even more powerful
abilities due to be immediately able to exploit the multiplatform, tested, cunning Java class
libraries that come for free with Java. :)
Here slides where business administration students who learn programming (in a course named
"Business Programming") as novices (!) in the second part of the semester (after two months learning
Rexx and then ooRexx from scratch) having become able to use all of Java as a huge external ooRexx
function and class library:
<https://wi.wu.ac.at/rgf/wu/lehre/autojava/material/foils/230_AutoJava_Sockets_V05.pdf> (the slides
also demonstrate how to take advantage of the Java SSL/TLS classes, it is actually quite easy). This
demonstrates among other things how easy it becomes to exploit Java from ooRexx for creating TCP
server and clients, and as one can see it is even easy doing the same with employing Java's SSL/TLS
from the Rexx programs! [BTW this has become possible because of ooRexx dynamic and message based
nature. Java objects suddenly understand ooRexx messages, the case of spelling method names or field
names is not relevant anymore and some more. Or invoking Java methods on the Java RexxProxy class
causes messages to be sent off to the proxied Rexx object and some more.]
Compare the Python library above with what Java allows for, here a nice overview article about it:
<https://liakh-aliaksandr.medium.com/java-sockets-i-o-blocking-non-blocking-and-asynchronous-fb7f066e4ede>.
Anything you see in the discussion about the POSIX definitions (that shine through that Python
library above and as such mandates the knowledge about it) , the explanations about blocking,
non-blocking, synchroneous, asynchroneous, multiplexing followed by the overview of respective Java
classes in an overview form as well as the nutshell Java samples (using Sockets, NIO, NIO2) can be
directly and immediately used/exploited from REXX in the form of ooRexx and NetRexx, where NetRexx
will even create native Java classes from your Rexx code (running at the speed of native code). If
wanting to keep the interactivity of an interpreter, the dynamics and the flexibility of ooRexx at
runtime then use that.
The point here is simple: everyone who has REXX skills can rather easily and immediately take
advantage of ooRexx or NetRexx.
The design principle of "human-centricness" of REXX defined by its inventor Mike F. Cowlishaw has
been successfully applied for these two Rexx languages as well, making it even for newcomers
(novices, see above!) easy to learn and take advantage of these Rexx languages (as a matter of fact
Mike F. Cowlishaw also designed NetRexx at IBM which later got open-sourced and gets further
developed by RexxLA.org).
Just try out these REXX variants, experiment a little bit, they open totally new doors in addition
to those you have been enjoying with classic REXX already, hence it will pay in any case.
:)
---rony
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN