AgNet - silverware Networking Interface Kit

by silver Harloe

Doc Index / project homepage

What is it?

This kit attempts to provide a relatively stable network interface which can support different 'listener' types interacting with a server while freeing the server from worrying about how to implement different interfaces or how to side-step the file descriptor limits inherit in most operating systems.

Basically, it is a protocol for server writing. Though it does come with a 'dummy server' for demonstration and testing purposes, no actual server is packaged with it. The protocol for communication with the server is so far implemented in C and Perl, with plans to write it in Java and C++ as well.

Currently, it consists of a 'multiplexer', which is the heart of the kit - the multiplexer configurably spawns one or more 'listeners' which await various kinds of network connections. It then sends along all data to the server. The server thus need not have any complicated network coding (listen for multiplexer, accept multiplexer, loop on multiplexer input - no need to write anything with 'select()' or worry about how to detect dead clients and such). It also contains one listener, 'tcplistener', which can be configured to accept telnet connections in character at a time or line mode, or to accept arbitrary tcp connections in 'binary' mode.

he kind of server it is good for is one in which threads/multiple processes would create more synchronization headaches than they would solve, and one in which a central resource (such as a communication stream) is shared by all clients, and one in which clients desire to maintain a constant connection. Thus AgNet would be a poor choice for, say, an 'ftp' or 'login' server, where each session is independent of the others. It would be a poor choice for a webserver, in which the protocol demands connectionless interaction. However, it is an excellent choice for a 'chat' server, a 'MUD' type game, and possibly turn-based games (though the last would work better with the addition of a client and restriction to 'binary' tcplistener). Because of the 'shared resource' nature, it would also be a poor choice for servers requiring shuffling large amounts of data between users - though it might be a good basis for a backbone in which peer-to-peer clients could find each other.

I personally have been running a chat system (silverchat) for 8 or 9 years now and am planning on rewriting it. I wrote AgNet so that I could develop the network portion separately and in a language good for networking (C), while developing the 'personality' of chat on its own, and in a language good for text handling (Perl). 'silverchat Mark II' will probably also be a project submission to at some time in the future.

I got the idea from a 'contentrator' that was attached to a MUD -- though the concentrator was limited to handling C programs and tcp/ip mudlike connections.

Doc Index

This project is hosted by Logo project homepage silver's homepage