mosq 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mosq/client.rb +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fb7d9f6a52b7740ad6b8e71678c14dc875a1d21
|
4
|
+
data.tar.gz: 122404f44d5ee206c6cde729d767e63ef04019f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443f4e38c1913995bcbf936d21607655b4ecd5666439ae0c0ff3dbeb14c307df908ef8c7f328f025a320c7cae37d89a1bfdb1e91b29bd81c00b7a0d24417d724
|
7
|
+
data.tar.gz: d34e741afa7f15d43d571362f83dc2f74087d64e7dc10e900874635c83b2c735b7795362e8fc62a3318d483f6f25ea4bb69f7125e180b13e6c52b35f1b2dd9c6
|
data/lib/mosq/client.rb
CHANGED
@@ -58,17 +58,22 @@ module Mosq
|
|
58
58
|
end
|
59
59
|
private :ptr
|
60
60
|
|
61
|
-
|
62
|
-
# It is necessary to call this before any other communication.
|
63
|
-
def start
|
61
|
+
def start_configure
|
64
62
|
Util.error_check "configuring the maximum number of inflight messages",
|
65
63
|
FFI.mosquitto_max_inflight_messages_set(ptr, @options[:max_in_flight])
|
66
64
|
|
67
65
|
Util.error_check "configuring the username and password",
|
68
|
-
FFI.mosquitto_username_pw_set(ptr, @options[:
|
66
|
+
FFI.mosquitto_username_pw_set(ptr, @options[:username], @options[:password])
|
69
67
|
|
70
68
|
Util.error_check "connecting to #{@options[:host]}",
|
71
69
|
FFI.mosquitto_connect(ptr, @options[:host], @options[:port], @options[:heartbeat])
|
70
|
+
end
|
71
|
+
private :start_configure
|
72
|
+
|
73
|
+
# Initiate the connection with the server.
|
74
|
+
# It is necessary to call this before any other communication.
|
75
|
+
def start
|
76
|
+
start_configure
|
72
77
|
|
73
78
|
@ruby_socket = Socket.for_fd(FFI.mosquitto_socket(ptr))
|
74
79
|
@ruby_socket.autoclose = false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mosq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe McIlvain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|