Method: FTW::Connection#write

Defined in:
lib/ftw/connection.rb

#write(data, timeout = nil) ⇒ Object

Write data to this connection. This method blocks until the write succeeds unless a timeout is given.

This method is not guaranteed to have written the full data given.

Returns the number of bytes written (See also IO#syswrite)



217
218
219
220
221
222
223
224
# File 'lib/ftw/connection.rb', line 217

def write(data, timeout=nil)
  #connect if !connected?
  if writable?(timeout)
    return @socket.syswrite(data)
  else
    raise FTW::Connection::WriteTimeout.new(self.inspect)
  end
end