Project

General

Profile

Bug #9543 ยป doc_lib_gserver.patch

stomar (Marcus Stollsteimer), 02/20/2014 07:35 PM

View differences:

lib/gserver.rb (Arbeitskopie)
# super(port, *args)
# end
# def serve(io)
# io.puts(Time.now.to_s)
# io.puts(Time.now.to_i)
# end
# end
#
......
attr_reader :port
# Host on which to bind, as a String
attr_reader :host
# Maximum number of connections to accept at at ime, as a Fixnum
# Maximum number of connections to accept at a time, as a Fixnum
attr_reader :maxConnections
# IO Device on which log messages should be written
attr_accessor :stdlog
......
# Called when a client connects, if auditing is enabled.
#
# +client+:: a TCPSocket instances representing the client that connected
# +client+:: a TCPSocket instance representing the client that connected
#
# Return true to allow this client to connect, false to prevent it.
def connecting(client)
......
# Called if #debug is true whenever an unhandled exception is raised.
# This implementation simply logs the backtrace.
#
# +detail+:: The Exception that was caught
# +detail+:: the Exception that was caught
def error(detail)
log(detail.backtrace.join("\n"))
end
......
# Create a new server
#
# +port+:: the port, as a Fixnum, on which to listen.
# +port+:: the port, as a Fixnum, on which to listen
# +host+:: the host to bind to
# +maxConnections+:: The maximum number of simultaneous connections to
# +maxConnections+:: the maximum number of simultaneous connections to
# accept
# +stdlog+:: IO device on which to log messages
# +audit+:: if true, lifecycle callbacks will be called. See #audit
    (1-1/1)