MPE/iX Network Programming Examples

When writing network programs on MPE/iX, you have several different APIs to choose from. Many people seem to believe that you must use C and Berkeley Sockets, but you can also use NetIPC Intrinsics and other programming languages. In fact, the Berkeley Sockets API is common in the Unix world and due to its parameter passing mainly useful for C programmers who compile and link with the Posix interfaces and libraries of MPE/iX. For other programming languages, the NetIPC Intrinsics are frequently more convenient due to their different style of parameter passing.

Here are a few examples, the first one shows a small client program using Berkeley Sockets, the second shows a pair of COBOL programs using NetIPC to talk to each other, and the third one is a program using the Posix API to be run under control of INETD (and thus not doing explicit socket calls at all). Please bear with me, the examples are only rough prototypes that I put together for my own education. Nevertheless, I'm sharing them here, just in case they can be useful for other people as well. At least as a starting point for own experiments.

Notice that Java examples are available elsewhere on this web site. Java is very convenient for network programming (among various other things), so you'd probably be surprised to compare Berkeley Sockets, NetIPC and java.net examples side by side.

Oh, and keep in mind that all network programs talk TCP/IP in the end, so you can mix and match the different APIs as appropriate,
for example, you can have a Java program using java.net talk to a COBOL program using NetIPC or a C program using Berkeley Sockets. The different APIs are just an interface to the operating system's network functionality.
 

Lars Appel, May 2000