Note: If you're using the Windows operating system, and you intend to use standard internet protocols such as FTP (ie, transfering complete files, and creating/deleting directories on remote computers), or HTTP (ie, sending and receiving web pages), then it is easier to use the Windows Internet functions instead of RexxSock. RexxSock is useful if you intend to create your own proprietary protocol on top of TCP/IP, to transfer data for purposes other than the above. For example, perhaps you wish to create a networked game where you will be transfering "player information" between the computers. Or, perhaps you wish to write some scripts that coordinate the management of some "registry/desktop settings" between two computers.
REXXSOCK.DLL itself uses another library that comes with your operating system. This library is referred to as a sockets library. It is this library that does all of the real work, and which contains functions to connect computers over a network and exchange data between them. The standard for this sockets library was developed at the University of California at Berkeley. This sockets library was designed to be called by programs written in a lower level computer language (typically, C/C++). It was not designed to be directly used by a REXX script. This Berkeley code has been ported to many different platforms, and consequently it is often used for networking support by programmers.
RexxSock calls the sockets library functions on behalf of your script. RexxSock can accept arguments/data from your script, and pass it on to the sockets library. So, RexxSock ultimately allows your script to (indirectly) call the functions in a sockets library. It acts as the "liason" between the REXX script and the functions in the sockets library. And that is RexxSock's whole purpose.
As one example of how RexxSock works together with both the REXX script and the sockets library:
The standard Berkeley sockets library has a routine called send(), to which a program passes a buffer filled with data, and the sockets library does all the work of connecting to another computer and sending that data to that remote computer. Your REXX script can't directly call that send() function in a sockets library. (Remember that the sockets library is not designed to work with the REXX language). The script needs an interface. Hence, RexxSock to the rescue. RexxSock has a function that a script can call to send data to a connected computer. That function, called SockSend(), then passes the script's data to the socket library's send() function.
For every function in the sockets library, RexxSock has an equivalent function that the REXX script can call, and which ultimately makes a call to that sockets library function. The benefit of this is that you can more easily translate networking code written in another language into a REXX script, utilizing RexxSock for the interface to the sockets library.
Sometimes, a sockets library function returns data to the calling program. Of course, this data is in the form that a lower level language like C/C++ can handle. It is not really in a suitable form for a REXX script, so part of the work that RexxSock also does is to convert that returned data into a form that the script can easily access/use.
And that's basically how RexxSock works as an interface to the sockets library.