mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
Based on a patch by Rafal Lisowski [Bug #7348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6f553027c5
commit
0f448061de
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Sep 21 00:21:08 2013 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
|
* 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@zzak.io>
|
Fri Sep 20 23:54:03 2013 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
* lib/gserver.rb: [DOC] correct gserver.rb license [Bug #8913]
|
* lib/gserver.rb: [DOC] correct gserver.rb license [Bug #8913]
|
||||||
|
|
|
@ -148,10 +148,16 @@ module OpenSSL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# SSLServer represents a TCP/IP server socket with Secure Sockets Layer.
|
||||||
class SSLServer
|
class SSLServer
|
||||||
include SocketForwarder
|
include SocketForwarder
|
||||||
|
# When true then #accept works exactly the same as TCPServer#accept
|
||||||
attr_accessor :start_immediately
|
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)
|
def initialize(svr, ctx)
|
||||||
@svr = svr
|
@svr = svr
|
||||||
@ctx = ctx
|
@ctx = ctx
|
||||||
|
@ -164,18 +170,22 @@ module OpenSSL
|
||||||
@start_immediately = true
|
@start_immediately = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the TCPServer passed to the SSLServer when initialized.
|
||||||
def to_io
|
def to_io
|
||||||
@svr
|
@svr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# See TCPServer#listen for details.
|
||||||
def listen(backlog=5)
|
def listen(backlog=5)
|
||||||
@svr.listen(backlog)
|
@svr.listen(backlog)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# See BasicSocket#shutdown for details.
|
||||||
def shutdown(how=Socket::SHUT_RDWR)
|
def shutdown(how=Socket::SHUT_RDWR)
|
||||||
@svr.shutdown(how)
|
@svr.shutdown(how)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Works similar to TCPServer#accept.
|
||||||
def accept
|
def accept
|
||||||
sock = @svr.accept
|
sock = @svr.accept
|
||||||
begin
|
begin
|
||||||
|
@ -189,6 +199,7 @@ module OpenSSL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# See IO#close for details.
|
||||||
def close
|
def close
|
||||||
@svr.close
|
@svr.close
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue