Skip to content

Commit

Permalink
Added transport option to Client construnctor
Browse files Browse the repository at this point in the history
  • Loading branch information
opengs authored and frederikaalund committed Nov 5, 2020
1 parent 0e7f77a commit 9a4591b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asyncio_mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class Client:
def __init__(self, hostname, port=1883, *, username=None, password=None,
logger=None, client_id=None, tls_context=None, protocol=None,
will=None, clean_session=None):
will=None, clean_session=None, transport="tcp"):
self._hostname = hostname
self._port = port
self._loop = asyncio.get_event_loop()
Expand All @@ -31,7 +31,7 @@ def __init__(self, hostname, port=1883, *, username=None, password=None,
if protocol is None:
protocol = mqtt.MQTTv311

self._client = mqtt.Client(client_id=client_id, protocol=protocol, clean_session=clean_session)
self._client = mqtt.Client(client_id=client_id, protocol=protocol, clean_session=clean_session, transport=transport)
self._client.on_connect = self._on_connect
self._client.on_disconnect = self._on_disconnect
self._client.on_subscribe = self._on_subscribe
Expand Down

0 comments on commit 9a4591b

Please # to comment.