You are here:

C++/programming a telnet server

Advertisement


Question
Hello!, Im a computer technican professionally and a computer nerd otherwise. Im looking to program a telnet server which i know is quite simple in programming terms, i can program decently in the Python language but dont have much experience with programming otherwise. I wanted to ask what language you would suggest that would be easy enough to learn fairly quickly how to program what i need in, I dont want to become a programming master and it doesnt have to be the most efficient language to write it in like C or assembly language hehe. Sorry for the long question. ( What language should i learn quickly to write a decent telnet server for a small game in )  thats the summary.
Thank you sir.  

Answer
[Sorry for the delay, the AllExpert site has not been accepting answer postings for many hours]

You asked a C++ expert. What answer do you expect me to give?<grin>

Seriously, if what you know is up to the job then use that. If not - because it lack facilities you require or a lack of efficiency or for other reasons - such as ease/cost/legality of deployment, then you should look at some other environment to develop your application in.

Now the point about me being a C++ expert has a serious side to it. I do not know all languages that might be useful for you. I looked very briefly at Python, more at Perl, a little Java, .NET and C# and of course the more 'traditional' languages such as C++, C, Pascal, FORTRAN (but not COBOL!), and various assembler languages - of which I am most at home these days with C++, and before that C.

Of course, you say you wish to develop a server for a 'small' game - by which I presume you mean 'simple'. Anyhow, whatever the size or complexity of the game - maybe you should use the same language as you are using for the game development. And of course the server aspect may restrict your choices. It may be the thing to do on your server platform to use a native build of a shared library, DLL or service executable or maybe you have to use a Java, Perl or PHP script to use with some middleware application such as a web server. The other point has to do with performance - you may decide to use, say, C++ to obtain a more efficient server. However, efficiency may not be a problem depending on the loading of the server and the software architectural techniques used.

Note that last part. Just using, say, C++ to gain performance will do no good if the underlying design of the server is inefficient - for example: you process each connection in one thread and block all other connections until the current one has terminated as you are busy doing work on behalf of the current connection. Obviously such a design is not going to work if you need to have more than one connection active at any one time no matter which language you use.

So my suggestion is stick with what you know (Python) to start with and invest in looking into how to write network server software. If your initial language choice proves inadequate then list your options - Perl, Java, .NET C#, C++, etc.. - and choose one that seems to fit your circumstances best. Ignore assembler. No one in their right mind would right such software in assembler by choice (OK maybe a few die-hards - but are they in their right minds..?).

Of these only C++ (and C and the like) will allow you to compile down to a native executable without additional runtime support (Perl interpreter, JVM in the case of Java or the .NET CLR). If you do decide to go the C++ route then you should look at the facilities provided by the ACE library (see http://www.cs.wustl.edu/~schmidt/ACE.html ) and related documentation and books. However C++ is _not_ an easy language to learn and apply well quickly - I suspect this may be true of many languages, but is especially true of C++ due to its depth (or breadth if you prefer). You might like to look at Accelerated C++ by Koenig and Moo - this is often sited as a good C++ starter book for those having already used at least one other programming language.

Have a look at the ACCU site for additional resources http://www.accu.org/  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ralph McArdell

Expertise

I am a software developer with more than 15 years C++ experience and over 25 years experience developing a wide variety of applications for Windows NT/2000/XP, UNIX, Linux and other platforms. I can help with basic to advanced C++, C (although I do not write just-C much if at all these days so maybe ask in the C section about purely C matters), software development and many platform specific and system development problems.

Experience

My career started in the mid 1980s working as a batch process operator for the now defunct Inner London Education Authority, working on Prime mini computers. I then moved into the role of Programmer / Analyst, also on the Primes, then into technical support and finally into the micro computing section, using a variety of 16 and 8 bit machines. Following the demise of the ILEA I worked for a small company, now gone, called Hodos. I worked on a part task train simulator using C and the Intel DVI (Digital Video Interactive) - the hardware based predecessor to Indeo. Other projects included a CGI based train simulator (different goals to the first), and various other projects in C and Visual Basic (er, version 1 that is). When Hodos went into receivership I went freelance and finally managed to start working in C++. I initially had contracts working on train simulators (surprise) and multimedia - I worked on many of the Dorling Kindersley CD-ROM titles and wrote the screensaver games for the Wallace and Gromit Cracking Animator CD. My more recent contracts have been more traditionally IT based, working predominately in C++ on MS Windows NT, 2000. XP, Linux and UN*X. These projects have had wide ranging additional skill sets including system analysis and design, databases and SQL in various guises, C#, client server and remoting, cross porting applications between platforms and various client development processes. I have an interest in the development of the C++ core language and libraries and try to keep up with at least some of the papers on the ISO C++ Standard Committee site at http://www.open-std.org/jtc1/sc22/wg21/.

Education/Credentials

©2012 About.com, a part of The New York Times Company. All rights reserved.