[前][次][番号順一覧][スレッド一覧]

ruby-changes:30916

From: zzak <ko1@a...>
Date: Sat, 21 Sep 2013 00:24:11 +0900 (JST)
Subject: [ruby-changes:30916] zzak:r42995 (trunk): * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer

zzak	2013-09-21 00:24:03 +0900 (Sat, 21 Sep 2013)

  New Revision: 42995

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42995

  Log:
    * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
      Based on a patch by Rafal Lisowski [Bug #7348]

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/lib/openssl/ssl.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42994)
+++ ChangeLog	(revision 42995)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Sep 21 00:21:08 2013  Zachary Scott  <e@z...>
+
+	* ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
+	  Based on a patch by Rafal Lisowski [Bug #7348]
+
 Fri Sep 20 23:54:03 2013  Zachary Scott  <e@z...>
 
 	* lib/gserver.rb: [DOC] correct gserver.rb license [Bug #8913]
Index: ext/openssl/lib/openssl/ssl.rb
===================================================================
--- ext/openssl/lib/openssl/ssl.rb	(revision 42994)
+++ ext/openssl/lib/openssl/ssl.rb	(revision 42995)
@@ -148,10 +148,16 @@ module OpenSSL https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L148
       end
     end
 
+    ##
+    # SSLServer represents a TCP/IP server socket with Secure Sockets Layer.
     class SSLServer
       include SocketForwarder
+      # When true then #accept works exactly the same as TCPServer#accept
       attr_accessor :start_immediately
 
+      # Creates a new instance of SSLServer.
+      # * +srv+ is an instance of TCPServer.
+      # * +ctx+ is an instance of OpenSSL::SSL::SSLContext.
       def initialize(svr, ctx)
         @svr = svr
         @ctx = ctx
@@ -164,18 +170,22 @@ module OpenSSL https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L170
         @start_immediately = true
       end
 
+      # Returns the TCPServer passed to the SSLServer when initialized.
       def to_io
         @svr
       end
 
+      # See TCPServer#listen for details.
       def listen(backlog=5)
         @svr.listen(backlog)
       end
 
+      # See BasicSocket#shutdown for details.
       def shutdown(how=Socket::SHUT_RDWR)
         @svr.shutdown(how)
       end
 
+      # Works similar to TCPServer#accept.
       def accept
         sock = @svr.accept
         begin
@@ -189,6 +199,7 @@ module OpenSSL https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L199
         end
       end
 
+      # See IO#close for details.
       def close
         @svr.close
       end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]