Method: Rex::IO::Stream#timed_write
- Defined in:
- lib/rex/io/stream.rb
#timed_write(buf, wait = def_write_timeout, opts = {}) ⇒ Object
This method writes to the stream, optionally timing out after a period of time.
163 164 165 166 167 168 169 170 171 |
# File 'lib/rex/io/stream.rb', line 163 def timed_write(buf, wait = def_write_timeout, opts = {}) if (wait and wait > 0) Timeout.timeout(wait) { return write(buf, opts) } else return write(buf, opts) end end |