go-mqtt 0.0.1

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.
data/lib/mqtt.rb ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'logger'
4
+ require 'socket'
5
+ require 'thread'
6
+ require 'timeout'
7
+
8
+ require 'mqtt/version'
9
+
10
+ module MQTT
11
+ # Default port number for unencrypted connections
12
+ DEFAULT_PORT = 1883
13
+
14
+ # Default port number for TLS/SSL encrypted connections
15
+ DEFAULT_SSL_PORT = 8883
16
+
17
+ # Super-class for other MQTT related exceptions
18
+ class Exception < ::Exception
19
+ end
20
+
21
+ # A ProtocolException will be raised if there is a
22
+ # problem with data received from a remote host
23
+ class ProtocolException < MQTT::Exception
24
+ end
25
+
26
+ # A NotConnectedException will be raised when trying to
27
+ # perform a function but no connection has been
28
+ # established
29
+ class NotConnectedException < MQTT::Exception
30
+ end
31
+
32
+ autoload :Client, 'mqtt/client'
33
+ autoload :Packet, 'mqtt/packet'
34
+ autoload :Proxy, 'mqtt/proxy'
35
+
36
+ # MQTT-SN
37
+ module SN
38
+ # Default port number for unencrypted connections
39
+ DEFAULT_PORT = 1883
40
+
41
+ # A ProtocolException will be raised if there is a
42
+ # problem with data received from a remote host
43
+ class ProtocolException < MQTT::Exception
44
+ end
45
+
46
+ autoload :Packet, 'mqtt/sn/packet'
47
+ end
48
+ end