ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sockets are sockets and should be pretty much the same in any language (including Java).
Agreed, but it would still be helpful to know what type of network programming is being considered, after all not all network programming would use sockets, (packet sniffers) and for well known tasks (web or database connections) some languages provide good wrapper functions.
Personally I'd probably use Perl (without more info). It's got plenty of pre-written modules for socket handling, so you can concentrate on doing something with the data.
For low level stuff C would be the normal choice.
You will get the most efficient app with C. If you have enough time and knowledge - use C! I'd choose Java only in the "Unknown platform - client side" case. Perl is not the bad choice for the server as well, however it's still the interpreted language if your server is powerfull enough.
sockets are sockets. But not all languages support multithreading equally well. You don't mention whether you'll need more than one thread, but most network servers will use some sort of threading support to respond to multiple client requests. C/C++ wins in terms of efficiency, but the pthread library is not for the faint of heart. Java definitely has better support for synchronization and mutexes. However, in terms of high level functionality combined with adequate efficiency, why not python ("import threading").
1. Threading is implemented as of 5.8 (in fact I've got/written a prog using threading and sockets in prodn).
2. Perl is not in fact interpreted; it's pseudo-compiled at startup into an executable env (see http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html for details) and then that is run. At a guess I'd say you get 85-90% the speed of C, basically to the pt where the design/algoritm is the limitng factor, not the lang.
FYI my prog handles updating Radius accting for 5K+ cxns easily (I tested up to 20K, seemed just fine).
Nonetheless, you should pick the lang you are most comfortable with if it does threads & sockets.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.