mydoghasworms / nwrfc

SAP Netweaver RFC SDK wrapper via Ruby-FFI
http://ceronio.net/nwrfc/
28 stars 14 forks source link

fc.invoke may never timeout? #5

Closed Meatballs1 closed 10 years ago

Meatballs1 commented 10 years ago

If a command invoked via SXPG_COMMAND_EXECUTE etc goes into a loop, then control never returns to ruby?

mydoghasworms commented 10 years ago

Do you have a standard function with which to test this?

Meatballs1 commented 10 years ago

I was calling sxpg_command_execute with the following to test:

ANYOS X_PYTHON PARAMS -c '%exec("import time"+chr(59)+"time.sleep(100)")%'

I have some wrapping around my calls but should be most of the bits:

    function = conn.get_function('SXPG_COMMAND_EXECUTE')
    fc = function.get_function_call
        fc[:COMMANDNAME] = 'X_PYTHON'
        fc[:OPERATINGSYSTEM] = 'ANYOS'
        fc[:ADDITIONAL_PARAMETERS] = command
    fc.invoke
          data = ''
          data_length = fc[:EXEC_PROTOCOL].size

          0.upto(data_length-1) do |i|
            data << fc[:EXEC_PROTOCOL][i][:MESSAGE] << "\n"
          end
mydoghasworms commented 10 years ago

Thanks for the fix. Sorry, it took me a while to get around to testing this.

Meatballs1 commented 10 years ago

No worries, thanks for updating :)