stomp 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/stomp.rb +7 -4
- metadata +39 -32
data/lib/stomp.rb
CHANGED
@@ -23,18 +23,19 @@ module Stomp
|
|
23
23
|
# synchronous receives
|
24
24
|
class Connection
|
25
25
|
|
26
|
-
def Connection.open(login = "", passcode = "", host='localhost', port=61613, reliable=FALSE, reconnectDelay=5)
|
27
|
-
Connection.new login, passcode, host, port, reliable, reconnectDelay
|
26
|
+
def Connection.open(login = "", passcode = "", host='localhost', port=61613, reliable=FALSE, reconnectDelay=5, clientId=nil)
|
27
|
+
Connection.new login, passcode, host, port, reliable, reconnectDelay, clientId
|
28
28
|
end
|
29
29
|
|
30
30
|
# Create a connection, requires a login and passcode.
|
31
31
|
# Can accept a host (default is localhost), and port
|
32
32
|
# (default is 61613) to connect to
|
33
|
-
def initialize(login, passcode, host='localhost', port=61613, reliable=false, reconnectDelay=5)
|
33
|
+
def initialize(login, passcode, host='localhost', port=61613, reliable=false, reconnectDelay=5, clientId=nil)
|
34
34
|
@host = host
|
35
35
|
@port = port
|
36
36
|
@login = login
|
37
37
|
@passcode = passcode
|
38
|
+
@clientId = clientId
|
38
39
|
@transmit_semaphore = Mutex.new
|
39
40
|
@read_semaphore = Mutex.new
|
40
41
|
@socket_semaphore = Mutex.new
|
@@ -54,7 +55,9 @@ module Stomp
|
|
54
55
|
@failure = NIL
|
55
56
|
begin
|
56
57
|
s = TCPSocket.open @host, @port
|
57
|
-
|
58
|
+
connect_headers = {:login => @login, :passcode => @passcode}
|
59
|
+
connect_headers[:"client-id"] = @clientId if @clientId
|
60
|
+
_transmit(s, "CONNECT", connect_headers)
|
58
61
|
@connect = _receive(s)
|
59
62
|
# replay any subscriptions.
|
60
63
|
@subscriptions.each { |k,v| _transmit(s, "SUBSCRIBE", v) }
|
metadata
CHANGED
@@ -1,46 +1,53 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.1
|
3
|
-
specification_version: 1
|
4
2
|
name: stomp
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2007-02-01 00:00:00 -08:00
|
8
|
-
summary: Ruby client for the Stomp messaging protocol
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: brianm@apache.org
|
12
|
-
homepage: http://stomp.codehaus.org/
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: false
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 1.0.6
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
rdoc_options: []
|
7
|
+
- Someone, possibly Andrew Kuklewicz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
36
11
|
|
37
|
-
|
12
|
+
date: 2008-11-10 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
38
15
|
|
16
|
+
description:
|
17
|
+
email: dev@stomp.codehaus.org
|
39
18
|
executables: []
|
40
19
|
|
41
20
|
extensions: []
|
42
21
|
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- lib/stomp.rb
|
26
|
+
has_rdoc: false
|
27
|
+
homepage: http://stomp.codehaus.org/
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: "0"
|
38
|
+
version:
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
43
45
|
requirements: []
|
44
46
|
|
45
|
-
|
47
|
+
rubyforge_project:
|
48
|
+
rubygems_version: 1.3.0
|
49
|
+
signing_key:
|
50
|
+
specification_version: 2
|
51
|
+
summary: Ruby client for the Stomp messaging protocol
|
52
|
+
test_files: []
|
46
53
|
|