Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
GServer /
Delete
Unzip
Name
Size
Permission
Date
Action
audit-i.ri
310
B
-rw-r--r--
2023-07-26 17:26
cdesc-GServer.ri
3.59
KB
-rw-r--r--
2023-07-26 17:26
connecting-i.ri
537
B
-rw-r--r--
2023-07-26 17:26
connections-i.ri
240
B
-rw-r--r--
2023-07-26 17:26
debug-i.ri
214
B
-rw-r--r--
2023-07-26 17:26
disconnecting-i.ri
453
B
-rw-r--r--
2023-07-26 17:26
error-i.ri
480
B
-rw-r--r--
2023-07-26 17:26
host-i.ri
204
B
-rw-r--r--
2023-07-26 17:26
in_service%3f-c.ri
608
B
-rw-r--r--
2023-07-26 17:26
join-i.ri
207
B
-rw-r--r--
2023-07-26 17:26
log-i.ri
454
B
-rw-r--r--
2023-07-26 17:26
maxConnections-i.ri
252
B
-rw-r--r--
2023-07-26 17:26
new-c.ri
893
B
-rw-r--r--
2023-07-26 17:26
port-i.ri
206
B
-rw-r--r--
2023-07-26 17:26
serve-i.ri
146
B
-rw-r--r--
2023-07-26 17:26
shutdown-i.ri
222
B
-rw-r--r--
2023-07-26 17:26
start-i.ri
530
B
-rw-r--r--
2023-07-26 17:26
starting-i.ri
253
B
-rw-r--r--
2023-07-26 17:26
stdlog-i.ri
224
B
-rw-r--r--
2023-07-26 17:26
stop-c.ri
528
B
-rw-r--r--
2023-07-26 17:26
stop-i.ri
195
B
-rw-r--r--
2023-07-26 17:26
stopped%3f-i.ri
227
B
-rw-r--r--
2023-07-26 17:26
stopping-i.ri
255
B
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalClass[iI"GServer:EF@I"Object;Fo:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"KGServer implements a generic server, featuring thread pool management,;TI"Dsimple logging, and multi-server management. See HttpServer in;TI"Q<tt>xmlrpc/httpserver.rb</tt> in the Ruby standard library for an example of;TI"GServer in action.;To:RDoc::Markup::BlankLine o; ;[I"NAny kind of application-level server can be implemented using this class.;TI"QIt accepts multiple simultaneous connections from clients, up to an optional;TI"Omaximum number. Several _services_ (i.e. one service per TCP port) can be;TI"Irun simultaneously, and stopped at any time through the class method;TI"O<tt>GServer.stop(port)</tt>. All the threading issues are handled, saving;TI"Pyou the effort. All events are optionally logged, but you can provide your;TI"$own event handlers if you wish.;T@S:RDoc::Markup::Heading: leveli: textI"Example;T@o; ;[I"OUsing GServer is simple. Below we implement a simple time server, run it,;TI"9query it, and shut it down. Try this code in +irb+:;T@o:RDoc::Markup::Verbatim;[$I"require 'gserver' ;FI" ;FI"# ;FI"=# A server that returns the time in seconds since 1970. ;FI"# ;FI" class TimeServer < GServer ;FI") def initialize(port=10001, *args) ;FI" super(port, *args) ;FI" end ;FI" def serve(io) ;FI" io.puts(Time.now.to_s) ;FI" end ;FI" end ;FI" ;FI"E# Run the server with logging enabled (it's a separate thread). ;FI"server = TimeServer.new ;FI"=server.audit = true # Turn logging on. ;FI"server.start ;FI" ;FI"R# *** Now point your browser to http://localhost:10001 to see it working *** ;FI" ;FI""# See if it's still running. ;FI"4GServer.in_service?(10001) # -> true ;FI"5server.stopped? # -> false ;FI" ;FI"(# Shut the server down gracefully. ;FI"server.shutdown ;FI" ;FI"+# Alternatively, stop it immediately. ;FI"GServer.stop(10001) ;FI"%# or, of course, "server.stop". ;Fo; ;[I"NAll the business of accepting connections and exception handling is taken;TI"Qcare of. All we have to do is implement the method that actually serves the;TI"client.;T@S;;i; I" Advanced;T@o; ;[ I"LAs the example above shows, the way to use GServer is to subclass it to;TI"Ocreate a specific server, overriding the +serve+ method. You can override;TI"Nother methods as well if you wish, perhaps to collect statistics, or emit;TI"more detailed logging.;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0;[o; ;[I"#connecting;To;;0;[o; ;[I"#disconnecting;To;;0;[o; ;[I"#starting;To;;0;[o; ;[I"#stopping;T@o; ;[I"KThe above methods are only called if auditing is enabled, via #audit=.;T@o; ;[I"MYou can also override #log and #error if, for example, you wish to use a;TI"'more sophisticated logging system.;T: @fileI"lib/gserver.rb;T;0[[ I" audit;FI"RW;F:publicF@n[ I" debug;FI"RW;F;F@n[ I" host;FI"R;F;F@n[ I"maxConnections;FI"R;F;F@n[ I" port;FI"R;F;F@n[ I"stdlog;FI"RW;F;F@n[[I"DEFAULT_HOST;Fo;;[ ;0@n[ [[I" class;F[[;[[I"in_service?;F@n[I"new;F@n[I" stop;F@n[:protected[ [:private[ [I" instance;F[[;[[I"connections;F@n[I" join;F@n[I" serve;F@n[I" shutdown;F@n[I" start;F@n[I" stop;F@n[I" stopped?;F@n[;[[I"connecting;F@n[I"disconnecting;F@n[I" error;F@n[I"log;F@n[I" starting;F@n[I" stopping;F@n[;[