socket_duplex 1.1.5 → 1.1.6
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 +4 -4
- data/lib/socket_duplex.rb +5 -4
- data/socket_duplex.gemspec +1 -1
- 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: ba10e612d5278cbe626c7e54595546bd783533c2
|
4
|
+
data.tar.gz: 37bf8986a52ca7e480edcfab09c528d46b3650dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 006b58d014a9f89b9eee9601420b67b12712855d1c25ecce2aebe7d308978cff2e05e7123dddf93723289980fa5c797d1e240c44d28b828bf51caf1a67d2c4e2
|
7
|
+
data.tar.gz: 7840fdd2bd34c6113e9b33d46581ca1a448cc665db60be9cb67488fc561eeb251d4aad8033701db60590b0102404aa62a28903354874249ef39e519705b593d8
|
data/lib/socket_duplex.rb
CHANGED
@@ -3,12 +3,13 @@ require 'socket'
|
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
5
|
require_relative 'websocket-client-simple'
|
6
|
+
require 'utils'
|
6
7
|
|
7
8
|
module Rack
|
8
9
|
class SocketDuplex
|
9
10
|
MAX_QUEUE_SIZE = 50
|
10
11
|
NUM_OF_THREADS = 5
|
11
|
-
@@queue = Utils::
|
12
|
+
@@queue = Utils::QueueWithTimeout.new
|
12
13
|
|
13
14
|
def initialize(app, socket_path, secful_key, verify_mode=OpenSSL::SSL::VERIFY_PEER)
|
14
15
|
@app, @socket_path, @verify_mode = app, socket_path, verify_mode
|
@@ -70,13 +71,13 @@ module Rack
|
|
70
71
|
def worker
|
71
72
|
loop do
|
72
73
|
begin
|
73
|
-
puts 'secful: worker start: ' + @@queue.__id__.to_s
|
74
|
+
#puts 'secful: worker start: ' + @@queue.__id__.to_s
|
74
75
|
begin
|
75
76
|
env = @@queue.pop_with_timeout(1)
|
76
77
|
rescue => e
|
77
|
-
puts 'secful: queue-pop-exception: ' + e.message
|
78
|
+
#puts 'secful: queue-pop-exception: ' + e.message
|
78
79
|
end
|
79
|
-
puts 'secful: worker poped'
|
80
|
+
#puts 'secful: worker poped'
|
80
81
|
if env
|
81
82
|
puts 'secful: env'
|
82
83
|
connect_to_ws(Thread.current)
|
data/socket_duplex.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "socket_duplex"
|
6
|
-
spec.version = '1.1.
|
6
|
+
spec.version = '1.1.6'
|
7
7
|
spec.authors = ["Secful"]
|
8
8
|
spec.description = %q{Rack middleware that duplexes HTTP traffic}
|
9
9
|
spec.summary = spec.description
|