njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
538 stars 135 forks source link

It is now possible to specify a timeout when opening a TCPSocket. #163

Open hiroeorz opened 2 months ago

hiroeorz commented 2 months ago

By specifying as follows, you can now specify the timeout time in seconds when MQTTClient opens a TCPSocket.

client = MQTT::Client.connect(
  :host => 'myserver.example.com',
  :connect_timeout => 15
)

The default timeout period is 30 seconds.