nobject 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee4d902fecae1f9b90bcd4d7d35004de2200204dc4ec69267ea96945e6336b45
4
- data.tar.gz: 2a89abb37e0f32b746eb347367e22877cf31bbb8c371a01a9e3dc4c5127be8e1
3
+ metadata.gz: bd180aa8332ff345c3b566b63e7eac6082698bd613d45ee6ac7085d4d5dbf7f0
4
+ data.tar.gz: 12694fe184ad4ec90519aaf521084aec94ae3cb102673c227c71eaa46038ebce
5
5
  SHA512:
6
- metadata.gz: c2d09b3192e694daa7a228dbc9ee265611091a75b8c8a9bec1cc883c4afbff0357213112df00efa28f2ecf481e94d79b69a020d56bcda8a546f004374990771a
7
- data.tar.gz: f353053268c9023bce7b8e13efe897dac8842a1ff7d7487f1ec22ce49d20a3f2b1dfc30f721f836cde35f442f138e4a645647f8a4174ce3b56c7d07bc89d491b
6
+ metadata.gz: 36ff5de72b6a2a2e2eba396d98e756f688bda3425cd8958e052b7e9594c8c1c375ee15c081efef5f72fd99f22364c57f1c22b335d92ccb11d9c6924a3d2b732e
7
+ data.tar.gz: ec691eda7babec588fbb14bfd96d050552e0e89c1e0a033b4203646794811c740f8bc3ca07f30e682bb3c588892692c6e6e8953f2fb582f222566f472da523e1
data/lib/nobject/local.rb CHANGED
@@ -13,10 +13,11 @@ module Nobject
13
13
  # # this will create a new Nobject::Local, then push it to the specified
14
14
  # server Nobject::Local.new('localhost', 1234, <object>)
15
15
  def initialize(host, port, obj)
16
+ @msg_counter = 0
16
17
  @socket = TCPSocket.new(host, port)
17
18
  obj_bytes = Marshal.dump(obj)
18
19
 
19
- File.open('/tmp/nobject.log', 'a') {|f| f.puts "L:#{obj_bytes.length}"; f.flush }
20
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts "L:#{@msg_counter += 1} #{obj_bytes.length}"; f.flush }
20
21
  @socket.send([obj_bytes.length].pack('Q>'), 0)
21
22
  @socket.send(obj_bytes, 0)
22
23
  end
@@ -27,7 +28,7 @@ module Nobject
27
28
 
28
29
  begin
29
30
  @socket.send([msg_bytes.length].pack('Q>'), 0)
30
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMS:#{msg_bytes.length}"; f.flush }
31
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMS:#{@msg_counter += 1} #{msg_bytes.length}"; f.flush }
31
32
  @socket.send(msg_bytes, 0)
32
33
  rescue Exception
33
34
  raise Local::MethodRequestFailure.new("did not receive response from call to `#{method}' over the network")
@@ -4,9 +4,10 @@ module Nobject
4
4
  # the method invocations onwards to this object
5
5
  class Remote
6
6
  def initialize(socket)
7
+ @msg_counter = 0
7
8
  @socket = socket
8
9
  obj_size = @socket.recv(8).unpack('Q>').first
9
- File.open('/tmp/nobject.log', 'a') {|f| f.puts "R:#{obj_size}"; f.flush }
10
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts "R:#{@msg_counter += 1} #{obj_size}"; f.flush }
10
11
  @obj = Marshal.load(@socket.recv(obj_size))
11
12
  end
12
13
 
@@ -14,7 +15,7 @@ module Nobject
14
15
  Thread.new do
15
16
  loop do
16
17
  msg_size = @socket.recv(8).unpack('Q>').first
17
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMR:#{msg_size}"; f.flush }
18
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMR:#{@msg_counter += 1} #{msg_size}"; f.flush }
18
19
  msg = Marshal.load(@socket.recv(msg_size))
19
20
 
20
21
  result = @obj.send(msg[:method], *msg[:args])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt