rxio 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a192fa9381b7872090a16feb90e28fe3fe6c1994
4
- data.tar.gz: 582612082630571b7ef3bd855620bedddd488e17
3
+ metadata.gz: e6f34344e2ac47e8498e3ef3c86d65ada23b7817
4
+ data.tar.gz: f77ce7121deb254fadc3c37b4a55322aafa8bac8
5
5
  SHA512:
6
- metadata.gz: 934b55278bcd8237d83d79c94374b2cb4e0ecc01eb6321a91388e22fb73fecbb94db2abd122ad2b743cc9986dd85c5a6c25b5af23d1875c6c6a388b93a4294b4
7
- data.tar.gz: 16939703ed1cc130e9f5b5be682a951890c67c12f1f3952d7f98ab0f698e80d3a45a75045b4390fe2c4360b5ac4a133d9fc7579ab3cc4ff10d5dc3e41ffa132e
6
+ metadata.gz: dd75cb72c3db49d10e894b7f1795f2a2f22f37eb1176f6e865ff01bc5ae8dc19dacf5dd2f0ca822bec5946b547c4413dbe808295a8b92c3e6743ecae85263c67
7
+ data.tar.gz: 390df2da1ecd9d2bd4059d2825bf9ef826745b0397ed94cb93bf090546bb0eee221799d9e102b1289cadf51ac68023130038f84079974067245c46c8ede2f8b3
@@ -28,43 +28,43 @@ module RxIO
28
28
  end
29
29
 
30
30
  # Filter Input
31
- # Buffers data chunks sent by the client and extracts messages from them, according to the delimiter defined through _msg_delim_.
32
- # @param [Hash] client
31
+ # Buffers data chunks sent by the endpoint and extracts messages from them, according to the delimiter defined through _msg_delim_.
32
+ # @param [Hash] endpoint
33
33
  # @param [String] chunk
34
- def filter_input client, chunk
34
+ def filter_input endpoint, chunk
35
35
 
36
36
  # Buffer dat shit
37
- buffer_input client, chunk
37
+ buffer_input endpoint, chunk
38
38
 
39
39
  # Ensure Last Position is available
40
- client[:bin_delim] ||= {}
41
- client[:bin_delim][:last_pos] ||= 0
40
+ endpoint[:bin_delim] ||= {}
41
+ endpoint[:bin_delim][:last_pos] ||= 0
42
42
 
43
43
  # Loop over Messages
44
44
  while true
45
45
 
46
46
  # Find Delimiter
47
- d = client[:ibuf].index @msg_delim, client[:bin_delim][:last_pos]
48
- client[:bin_delim][:last_pos] = client[:ibuf].bytesize
47
+ d = endpoint[:ibuf].index @msg_delim, endpoint[:bin_delim][:last_pos]
48
+ endpoint[:bin_delim][:last_pos] = endpoint[:ibuf].bytesize
49
49
 
50
50
  # Check Delimiter
51
51
  break unless d
52
52
 
53
53
  # Slice out Message from Input Buffer
54
- m = client[:ibuf].slice!(0, d + @msg_delim.bytesize).slice 0, d
55
- client[:bin_delim][:last_pos] = 0
54
+ m = endpoint[:ibuf].slice!(0, d + @msg_delim.bytesize).slice 0, d
55
+ endpoint[:bin_delim][:last_pos] = 0
56
56
 
57
57
  # Register Message
58
- client[:msgs] << m
58
+ endpoint[:msgs] << m
59
59
  end
60
60
  end
61
61
 
62
62
  # Send Message
63
- # Buffers a message to be sent to the client, after wrapping it according to the delimiter defined through _msg_delim_.
64
- # @param [Hash] client
63
+ # Buffers a message to be sent to the endpoint, after wrapping it according to the delimiter defined through _msg_delim_.
64
+ # @param [Hash] endpoint
65
65
  # @param [String] msg
66
- def send_msg client, msg
67
- write client, msg, @msg_delim
66
+ def send_msg endpoint, msg
67
+ write endpoint, msg, @msg_delim
68
68
  end
69
69
  end
70
70
  end
@@ -21,40 +21,40 @@ module RxIO
21
21
  end
22
22
 
23
23
  # Filter Input
24
- # Buffers data chunks sent by the client and extracts messages from them, according to the *size* field present at the beginning of each message.
25
- # @param [Hash] client
24
+ # Buffers data chunks sent by the endpoint and extracts messages from them, according to the *size* field present at the beginning of each message.
25
+ # @param [Hash] endpoint
26
26
  # @param [String] chunk
27
- def filter_input client, chunk
27
+ def filter_input endpoint, chunk
28
28
 
29
29
  # Buffer dat shit
30
- buffer_input client, chunk
30
+ buffer_input endpoint, chunk
31
31
 
32
32
  # Loop over Messages
33
33
  while true
34
34
 
35
35
  # Check Buffer Size (can we at least determine the next message size?)
36
- break unless client[:ibuf].bytesize >= 4
36
+ break unless endpoint[:ibuf].bytesize >= 4
37
37
 
38
38
  # Acquire Message Size
39
- size = client[:ibuf][0, 4].unpack 'N'
39
+ size = endpoint[:ibuf][0, 4].unpack 'N'
40
40
 
41
41
  # Check Buffer Size again (is the complete message present in the buffer?)
42
- break unless client[:ibuf].bytesize >= 4 + size
42
+ break unless endpoint[:ibuf].bytesize >= 4 + size
43
43
 
44
44
  # Slice out Message from Input Buffer
45
- m = client[:ibuf].slice!(0, 4 + size)[4, size]
45
+ m = endpoint[:ibuf].slice!(0, 4 + size)[4, size]
46
46
 
47
47
  # Register Message
48
- client[:msgs] << m
48
+ endpoint[:msgs] << m
49
49
  end
50
50
  end
51
51
 
52
52
  # Send Message
53
- # Buffers a message to be sent to the client, after prefixing it with a _size_ field.
54
- # @param [Hash] client
53
+ # Buffers a message to be sent to the endpoint, after prefixing it with a _size_ field.
54
+ # @param [Hash] endpoint
55
55
  # @param [String] msg
56
- def send_msg client, msg
57
- write client, [msg.bytesize].pack('N'), msg
56
+ def send_msg endpoint, msg
57
+ write endpoint, [msg.bytesize].pack('N'), msg
58
58
  end
59
59
  end
60
60
  end
data/lib/rxio/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  module RxIO
6
6
 
7
7
  # Version
8
- VERSION = '0.12.0'
8
+ VERSION = '0.12.1'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse