You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2008/06/18 03:03:33 UTC
svn commit: r668935 - in /incubator/thrift/trunk/tutorial/rb: RubyClient.rb
RubyServer.rb
Author: kclark
Date: Tue Jun 17 18:03:33 2008
New Revision: 668935
URL: http://svn.apache.org/viewvc?rev=668935&view=rev
Log:
Update the tutorial files to stop using deprecated names
Modified:
incubator/thrift/trunk/tutorial/rb/RubyClient.rb
incubator/thrift/trunk/tutorial/rb/RubyServer.rb
Modified: incubator/thrift/trunk/tutorial/rb/RubyClient.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/tutorial/rb/RubyClient.rb?rev=668935&r1=668934&r2=668935&view=diff
==============================================================================
--- incubator/thrift/trunk/tutorial/rb/RubyClient.rb (original)
+++ incubator/thrift/trunk/tutorial/rb/RubyClient.rb Tue Jun 17 18:03:33 2008
@@ -3,16 +3,16 @@
$:.push('../gen-rb')
$:.unshift '../../lib/rb/lib'
-require 'thrift/transport/tsocket'
-require 'thrift/protocol/tbinaryprotocol'
+require 'thrift'
+require 'thrift/protocol/binaryprotocol'
require 'Calculator'
begin
port = ARGV[0] || 9090
- transport = TBufferedTransport.new(TSocket.new('localhost', port))
- protocol = TBinaryProtocol.new(transport)
+ transport = Thrift::BufferedTransport.new(Thrift::Socket.new('localhost', port))
+ protocol = Thrift::BinaryProtocol.new(transport)
client = Calculator::Client.new(protocol)
transport.open()
Modified: incubator/thrift/trunk/tutorial/rb/RubyServer.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/tutorial/rb/RubyServer.rb?rev=668935&r1=668934&r2=668935&view=diff
==============================================================================
--- incubator/thrift/trunk/tutorial/rb/RubyServer.rb (original)
+++ incubator/thrift/trunk/tutorial/rb/RubyServer.rb Tue Jun 17 18:03:33 2008
@@ -3,8 +3,8 @@
$:.push('../gen-rb')
$:.unshift '../../lib/rb/lib'
-require 'thrift/transport/tsocket'
-require 'thrift/protocol/tbinaryprotocol'
+require 'thrift'
+require 'thrift/protocol/binaryprotocol'
require 'thrift/server/tserver'
require 'Calculator'
@@ -69,9 +69,9 @@
handler = CalculatorHandler.new()
processor = Calculator::Processor.new(handler)
-transport = TServerSocket.new(9090)
-transportFactory = TBufferedTransportFactory.new()
-server = TSimpleServer.new(processor, transport, transportFactory)
+transport = Thrift::ServerSocket.new(9090)
+transportFactory = Thrift::BufferedTransportFactory.new()
+server = Thrift::SimpleServer.new(processor, transport, transportFactory)
puts "Starting the server..."
server.serve()