Class: WANG::TCPSocket
- Inherits:
-
TCPSocket
- Object
- TCPSocket
- WANG::TCPSocket
- Defined in:
- lib/wang.rb
Overview
add the timeouts :nodoc:
Constant Summary collapse
- TIMEOUT_READ =
%w{read readpartial gets readline}
Instance Method Summary collapse
-
#initialize(*args) ⇒ TCPSocket
constructor
allows passing of the timeout values.
Constructor Details
#initialize(*args) ⇒ TCPSocket
allows passing of the timeout values
42 43 44 45 46 47 |
# File 'lib/wang.rb', line 42 def initialize *args # allows passing of the timeout values custom_args = args.shift @read_timeout = custom_args[:read_timeout] open_timeout = custom_args[:open_timeout] Timeout::timeout(open_timeout) { super } end |