rxio 0.13.7 → 0.13.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/lib/rxio/handler_base.rb +1 -1
- data/lib/rxio/io_base.rb +2 -3
- data/lib/rxio/version.rb +1 -1
- data/lib/rxio.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18bc4262038bb35d3bc783c5a54697d654762510
|
4
|
+
data.tar.gz: f47b9712ac1a9c82293f5bb60d73733975826825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5614445d46e496f223df75f7226530ca376f0347a4a9f80c758c55fb270c81fef4c61ef877490795ad89b8e501cd618d413dd4ba64f070aac5e8ae2094819a0
|
7
|
+
data.tar.gz: 7b0f94692c4edee68e03085cc450edfd2e70e766015f848a8fe268db31035645ecb4fe4c35bdbf464cdb1cbcaddfe8412c32f62da950618909cca3f3e9575858
|
data/README.md
CHANGED
@@ -309,16 +309,15 @@ es.shutdown
|
|
309
309
|
puts 'Client has terminated!'
|
310
310
|
```
|
311
311
|
|
312
|
-
### Dealing with Peer Errors
|
312
|
+
### Dealing with Peer Errors
|
313
313
|
|
314
314
|
Whenever an error occurs as the result of handling a peer's message, it should be notified through the *peer_error* method in *RxIO::IOBase* (included in *RxIO::Service*).
|
315
|
-
The default implementation of this method simply
|
315
|
+
The default implementation of this method simply drops the peer.
|
316
316
|
It can be overloaded to provide custom functionality such as proper logging or more complex logic.
|
317
317
|
|
318
318
|
```ruby
|
319
319
|
# Default implementation for 'peer_error'
|
320
320
|
def peer_error p, e
|
321
|
-
puts "[!] ERROR [#{p[:peer][:addr]}:#{p[:peer][:port]}] - #{e}"
|
322
321
|
drop_endpoint p
|
323
322
|
end
|
324
323
|
```
|
data/lib/rxio/handler_base.rb
CHANGED
@@ -15,7 +15,7 @@ module RxIO
|
|
15
15
|
def write endpoint, *data
|
16
16
|
|
17
17
|
# Add Data Chunks to Buffer
|
18
|
-
data.each { |c| endpoint[:lock].synchronize { endpoint[:obuf] << c } }
|
18
|
+
data.each { |c| endpoint[:lock].synchronize { endpoint[:obuf] << c.to_s } }
|
19
19
|
end
|
20
20
|
|
21
21
|
# Buffer Input Chunk:
|
data/lib/rxio/io_base.rb
CHANGED
@@ -92,9 +92,8 @@ module RxIO
|
|
92
92
|
# Peer Error:
|
93
93
|
# Handles an Error from a Peer.
|
94
94
|
# @param [Hash] p Endpoint Hash
|
95
|
-
# @param [
|
96
|
-
def peer_error p,
|
97
|
-
puts "[!] ERROR [#{p[:peer][:addr]}:#{p[:peer][:port]}] - #{e} - #{e.backtrace.collect { |b| " * #{b}" }.join "\n"}"
|
95
|
+
# @param [Exception] e Exception
|
96
|
+
def peer_error p, _e
|
98
97
|
drop_endpoint p
|
99
98
|
end
|
100
99
|
end
|
data/lib/rxio/version.rb
CHANGED
data/lib/rxio.rb
CHANGED