Why is the timeout needed? Is there some kind of error from mqtt.connect? The network layer should delay any transmission/reception until after the connection has been made.
... This is actually something that needs sorting generally - Espruino calls the 'connected' callback before the connection has actually been made (the current internal API for networking wasn't really meant for non-blocking connections).
© Espruino, powered by microcosm.
Report a problem