magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1997 > 05 > Features  

An Internet Chat Server

Building a Telnet-based Chat system in C

By Andrew Davison

One of the most popular Internet pastimes is connecting to a chat or talker server, strolling into a room of interesting people, and spending a few hours talking about meaningful (or perhaps not so meaningful) topics. This article outlines the key features of a simple chat server written in C. I'll concentrate on the networking aspects, but will also examine the implementation of a few user commands. The complete program, chat.c, is available electronically; see "Source Code" and fivedots.coe.psu.ac.th/~ad/code/chat/chat.c.

To join in a chat session, a user connects to the chat server via telnet. After typing a (unique) name, the user can move around the chat rooms, listening to or taking part in conversations. Online help is available, as well as general information about the rooms. Upon entering a room, the user gets a short description, along with a list of the other people in the room and the most recent public conversations. A user can talk to everyone in the room, have a private conversation (so long as the other person agrees), or send email to the chat superuser (useful for reporting the misbehavior of other visitors).

The superuser has additional "powers." He or she can terminate a visitor's connection, send superuser warnings, and ban users from the server. (Actually, the banning applies to the client's host machine, which is a little Draconian, but easy to code.) The superuser can also shut down everyone's connection (perhaps prior to closing down the server) and view user details kept by chat.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2