chatserver.rb

Path: examples/chatserver.rb
Last Update: Thu Jan 06 02:26:49 +0000 2011

chatserver.rb

This is an extremely crude and simple single-threaded multiplexing chat server. It (hopefully) demonstrates how to use a Poll object to do IO multiplexing with events.

Synopsis

  $ chatserver.rb [HOST [PORT [POLLDELAY]]]
HOST
The host or IP the server will bind to
PORT
The port the server will listen on
POLLDELAY
The number of floating-point seconds between polls. Specifying -1 (or any negative number, really) here will make the server call poll() in blocking mode.

Author

Michael Granger <ged@FaerieMUD.org>

Copyright (c) 2002 The FaerieMUD Consortium. All rights reserved.

This program is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Version

 $Id: chatserver.rb,v 1.2 2002/07/20 16:03:01 deveiant Exp $

Required files

poll   socket  

[Validate]