From 52c034aecb365c6cf2a41b8648c3e87fb335fdaf Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 4 Aug 2006 18:05:50 +0000 Subject: Documentation cleanup. Includes patches by Hugh Sasse: * ping.rb * weakref.rb * mailread.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/gserver.rb | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'lib/gserver.rb') diff --git a/lib/gserver.rb b/lib/gserver.rb index 371fceb290..eb5f31b7b3 100644 --- a/lib/gserver.rb +++ b/lib/gserver.rb @@ -12,21 +12,23 @@ require "socket" require "thread" # -# +GServer+ implements a generic server, featuring thread pool management, simple logging, and -# multi-server management. See xmlrpc/httpserver.rb in the Ruby standard library for -# an example of +GServer+ in action. -# -# Any kind of application-level server can be implemented using this class. It accepts -# multiple simultaneous connections from clients, up to an optional maximum number. Several -# _services_ (i.e. one service per TCP port) can be run simultaneously, and stopped at any time -# through the class method GServer.stop(port). All the threading issues are handled, -# saving you the effort. All events are optionally logged, but you can provide your own event -# handlers if you wish. +# GServer implements a generic server, featuring thread pool management, +# simple logging, and multi-server management. See HttpServer in +# xmlrpc/httpserver.rb in the Ruby standard library for an example of +# GServer in action. +# +# Any kind of application-level server can be implemented using this class. +# It accepts multiple simultaneous connections from clients, up to an optional +# maximum number. Several _services_ (i.e. one service per TCP port) can be +# run simultaneously, and stopped at any time through the class method +# GServer.stop(port). All the threading issues are handled, saving +# you the effort. All events are optionally logged, but you can provide your +# own event handlers if you wish. # # === Example # -# Using +GServer+ is simple. Below we implement a simple time server, run it, query it, and -# shut it down. Try this code in +irb+: +# Using GServer is simple. Below we implement a simple time server, run it, +# query it, and shut it down. Try this code in +irb+: # # require 'gserver' # @@ -60,14 +62,16 @@ require "thread" # GServer.stop(10001) # # or, of course, "server.stop". # -# All the business of accepting connections and exception handling is taken care of. All we -# have to do is implement the method that actually serves the client. +# All the business of accepting connections and exception handling is taken +# care of. All we have to do is implement the method that actually serves the +# client. # # === Advanced # -# As the example above shows, the way to use +GServer+ is to subclass it to create a specific -# server, overriding the +serve+ method. You can override other methods as well if you wish, -# perhaps to collect statistics, or emit more detailed logging. +# As the example above shows, the way to use GServer is to subclass it to +# create a specific server, overriding the +serve+ method. You can override +# other methods as well if you wish, perhaps to collect statistics, or emit +# more detailed logging. # # connecting # disconnecting @@ -76,8 +80,8 @@ require "thread" # # The above methods are only called if auditing is enabled. # -# You can also override +log+ and +error+ if, for example, you wish to use a more sophisticated -# logging system. +# You can also override +log+ and +error+ if, for example, you wish to use a +# more sophisticated logging system. # class GServer -- cgit v1.2.3