I'd like to develop software program that communicates between clients. What is the best programming language to do this?
The language that you know that best and can handle sockets. Network programming is not better on one language verses another. As long as the language can effectively handle the data that is being received and can format the data that is going it out, it is an acceptable candidate.
The whole point of networking is to bridge non-uniform machines.
There is no one best language for this, just like for almost anything else.
Use a language that you know and can do sockets. There are a lot of them.
I usually use Perl or C. Perl is helpful because it helps manage memory for you, process strings (common for network code) and prevent buffer overflows. But really I used it because I know it already.
Use what you know.
Don't forget to do your communications in network byte order. If you don't, you'll likely be sorry later.
The language you are writing the client software with, if it's adequate, and almost any client language would be. Keep things simple.
For the topics you described, you need to understand operating systems more than any specific language. Once the OS level becomes clear, the code is quite obvious in any decent language (although, Python is great for that).
This is one of the best books ever written:
Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series) (Paperback)
ISBN-10: 0321525949
ISBN-13: 978-0321525949
5 star amazon reviews (I'd give it 6).
Once I realized that networking, file I/O, shared memory, IPC, sockets, signals, etc... are all provided by the OS layer, then this became the answer to a lot of questions.
Then going back to language X (or Python), you understand what all the stuff in the os module means, and can write really advanced programs with ease.
If you already know some Python (which I'm assuming you do, as the question is tagged with Python), then I'd really recommend taking a look at Python's Twisted library.
Twisted is an asynchronous comms library that does all of the hard work for you - so you don't have to get involved with the underlying sockets library. Twisted can be a little tricky to get used to initially, but very quickly you'll be writing some very effective code to handle both clients and servers.
All languages have some sort of libraries for network programming, usually Sockets (anyone here remember TLI
/XTI
?). Sockets originally is C API so sockets implementation in other languages can be limited.
Example: colleague of mine, who is Java programmed, asked me for advice on using TCP keepalive. I told him to use SO_KEEPIDLE
option and then he discovered that Java socket API doesn't have it - you can only switch keepalive on but you have no control on the keepalive frequency. There are probably some other bits and pieces missing in Java Socket API. Don't know about other languages but my guess is there are some omissions as well.
So if you are proficient in C, grab Stevens' UNP Volume 1 (not APUE, as other poster suggested - APUE is good, but UNP1 serves your purpose better) and code everything in C.