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.
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.