Communication through simple sockets
It is possible to transfer information between applications that are written in different languages using sockets. The socket concept is not unique to Java and has been implemented in many languages. As sockets work at the TCP/IP level, they can communicate without much effort.
The primary interoperability consideration concerns the data that is transmitted. Incompatibilities can occur when the internal representation of data differs significantly between two different languages. This may be due to the use of big endian versus little endian in how a data type is represented internally, and whether a particular data type even exists in another language. For example, in C there is no distinct Boolean data type. It is represented using an integer.
In this section, we will develop a server in Java and a client in C#. To demonstrate the use sockets, a string will be transferred between these two applications. We will find that transferring even a simple data...