Description
I tried the Node.js tutorial server with the Ruby client, but the server failed as follows:
console #1
thrift/tutorial/nodejs$ make tutorialserver
NODE_PATH="../../lib/nodejs:../../lib/nodejs/lib:" /usr/bin/nodejs NodeServer.js
console #2
thrift/tutorial/rb$ make tutorialclient /home/sekikn/repos/thrift/compiler/cpp/thrift --gen rb -r ../../tutorial/tutorial.thrift /home/sekikn/.rbenv/shims/ruby RubyClient.rb Unable to load thrift_native extension. Defaulting to pure Ruby libraries. ping() /home/sekikn/repos/thrift/lib/rb/lib/thrift/protocol/base_protocol.rb:256: warning: constant ::Fixnum is deprecated /home/sekikn/repos/thrift/lib/rb/lib/thrift/protocol/base_protocol.rb:296: warning: constant ::Fixnum is deprecated 1+1=2 1+4=5 15-10=5 Log: 5 InvalidOperation: Cannot divide by 0 zip
console #1
ping() add( 1 , 1 ) add( 1 , 4 ) calculate( 1 , { num1: 15, num2: 10, op: 2, comment: null } ) getStruct( 1 ) calculate( 1 , { num1: 1, num2: 0, op: 4, comment: null } ) zip() events.js:183 throw er; // Unhandled 'error' event ^ ReferenceError: result is not defined at Object.zip (/home/sekikn/repos/thrift/tutorial/nodejs/NodeServer.js:80:5) at exports.Processor.CalculatorProcessor.process_zip (/home/sekikn/repos/thrift/tutorial/nodejs/gen-nodejs/Calculator.js:731:17) at exports.Processor.CalculatorProcessor.process (/home/sekikn/repos/thrift/tutorial/nodejs/gen-nodejs/Calculator.js:599:39) at /home/sekikn/repos/thrift/lib/nodejs/lib/thrift/server.js:67:21 at Socket.<anonymous> (/home/sekikn/repos/thrift/lib/nodejs/lib/thrift/buffered_transport.js:59:5) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) Makefile:639: recipe for target 'tutorialserver' failed make: *** [tutorialserver] Error 1
result is undefined here, because zip is a one-way function and result is not passed to it.
thrift/tutorial/nodejs/NodeServer.js
78 zip: function() { 79 console.log("zip()"); 80 result(null); 81 }
Attachments
Issue Links
- links to