Link to home
Start Free TrialLog in
Avatar of Noiroi
Noiroi

asked on

Creating a telnet server with viscual c++ 5.0

env: win95  compiler:msvc++ 5.0

What I would like to do is create a telnet server using mfc (if practical). I've been giving this some thought and decided that use of a sdi would be best. I've alreay layed out what I think the shell should look like, but I'm compeletly lost with the acutal code for the server. This server will serve as a mud server. I'd like for it to handle as many ppl as my system can handle. I'm not sure what other info one would need to answer this question.
recap:
1. a telnet server using msvc++ 5.0
2. created as a SDI
3. will serve as a MUD/Chat server (nonirc)
4. run on win32 systems
5. if any more info is needed please ask.

as a side note, i do know the differences between stream, raw, and data sockets. I've been doing some reading of my own :) Thanks for your time.
Avatar of igroove
igroove

Your best bet, since I have worked in developing software in this arena - is to use MFC's great CAsyncSocket (actually, your derived class from it) to handle the server "listening" socket, and create CAsyncSocket derived classes for each connection.  Since you're writing a SERVER, you should think about the end installed system OS, whether NT or 95 or 98...  the best performance and larget # of ppl you'd be able to handle would be on an NT system (either workstation or server).

Still, you should note that the server prolly would be _dedicated_ to use of your software, since it will be highly memory and process intensive in the end.

Read up on CAsyncSocket and threads.  Also, look at the source code for successful MUDs/MOOs like lambda moo (ftp.lambda.parc.xerox.com), and coolmud (don't know one specific ftp, but you can search for it at http://www.godlike.com./muds/mres/mftp.html - the MUD resource site).

Examine how they handle sockets - note that you'll have it sooo much easier in MFC!

Also, you'll need a copy of BISON/FLEX ported to Win32 in order to compile a "parser" if you're going to allow any sort of programming of objects in your system.  You can get one from www.cygnus.org or from my site www.cyberdrive.net/~igroove/ie (note you'll need IE4.0 to view my site).  My port of bison runs _without_ any additional DLLs or LIBs.

If it's a server, you won't need an omnipresent UI, though a system tray icon would be nice so a "local admin" can right click on it for a menu to do things to it like stop it, or see who's on, or checkpoint/dump it.

There's a lot to think about, and it's no small project if you've no server writing experience.

BEST OF LUCK!  and let us all know how it goes!
Avatar of Noiroi

ASKER

While the information given by Igroove was informative, it was still lacking in the information I need. I've read up on CAsyncSocket and have books (by Kate Gregory) on the topic, but not on Telnet. I've looked at the code for various muds(rom, circle, mud++) but I need a MFC example to follow. I don't know _how_ to use it properly.
Noiroi, you can get a *huge* amount of information, as well as great advice from:
  http://www.kanga.nu/~petidomo/lists/mud-dev

I've written a couple servers, and one of them happened to be a MUD. Here's my basic
development process for it:

The first thing to do would be to get your server working first of all.
Do a search on the web for "BSD SOCKET TUTORIAL". Winsock and Winsock2
follow the BSD Socket standard in certain respects. you may also try "VC++ SOCKET
TUTORIAL" so that you follow any MFC guidelines...

Once you have the server up, and listening, and it can accepts connections, then
decide on the "command set" you want to use for the MUD. Lot's of standard ones, and
if you're a MUD'er yourself, you are probably familiar with some already. like,
"kill <name>", "get <object>" and so on... basically, you want to read in their command,
parse the line, and determine which action to do based on their command.
Avatar of Noiroi

ASKER

Thank you for giving me more information to search on. I' going to reopen the question, because one can n'ver have too much information.
ASKER CERTIFIED SOLUTION
Avatar of bequette
bequette

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Noiroi

ASKER

Thank you for your response. Also, thank everyone for their respones, I appreciate the guidence provided. If anyone knows of some help reading material, please suggest it. Thank you again. Noiroi