March 2005 Archives

March 17, 2005 2:54 PM

Concurrent Client TCP/IP Server in C

Hades is (or will be) a MUD (multi-user dungeon) text-based game played over a network. My intention was to exercise programming a concurrent client TCP/IP server in C. After a little under 2 hours of actual coding, I bring you version 0.1. Multiple clients can connect to the server and chat under their own unique handles. That is basically the only feature . Although I have ideas for implementing a system for reading map files (rooms/environment) and for characters to find and hold items etc. Problem is, I don't have the time nor the desire to write up all those descriptions and character classes and other complex elements that make a MUD fun. So if you are new to network programming like I am, and/or you find developing a game like this appealing, let me know, it might be a fun project. Programming experience wouldn't be required for those who would want to make maps/items/characters/etc.

Download hades-0.1.tar.gz.

March 02, 2005 2:31 AM

A basic TCP/IP server in C

Would you like to see some very straight-forward, well commented, code for a basic connection-oriented TCP/IP server in C? Look no further. (This is for *nix)

echosrv.c -- An echo server.

This server is a bare bones example of the socket programming
necessary for creating servers using the TCP/IP protocol.

You can specify an address and port as a colon seperated argument:

        $ ./echosrv 192.168.0.1:2601

Without arguments, echosrv will use the loopback device
on port 9090. (127.0.0.1:9090)

Caustiq <http://caustiq.esoteriq.org>

Download echosrv.tar.gz.

You should be able to easily extend this code to all sorts of applications. Underground chat servers, muds, backdoors, etc. Also, there's a program I am working on that will allow concurrent clients on one server. It will make for some great example code.

Learn your socket programming, develop your own tools, and above all -- share your knowledge and creations.