def write( buf )
      until buf.nil? or (buf.length == 0) do
        written = socket.write_nonblock(buf)
        buf = buf[written, buf.length]
      end
    rescue Errno::EWOULDBLOCK, Errno::EINTR, Errno::EAGAIN, Errno::ECONNRESET
      if wait_writable(write_timeout)
        retry
      else
        raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
      end
    end
def write( buf )
      until buf.nil? or (buf.length == 0) do
        written = socket.write_nonblock(buf)
        buf = buf[written, buf.length]
      end
    rescue Errno::EWOULDBLOCK, Errno::EINTR, Errno::EAGAIN, Errno::ECONNRESET
      if wait_writable(write_timeout)
        retry
      else
        raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
      end
    end
Internal: Write the given data to the socket

 buf - the data to write to the socket.

 Raises an error if it is unable to write the data to the socket within the
 write_timeout.

 returns nothing