Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HelloMQTT by
Diff: MQTTNetwork.h
- Revision:
- 21:a7506c90aa84
- Parent:
- 20:49c9daf2b0ff
- Child:
- 22:826657a00c44
--- a/MQTTNetwork.h Tue Jan 10 18:10:17 2017 -0600
+++ b/MQTTNetwork.h Tue Mar 21 03:32:27 2017 +0000
@@ -5,8 +5,10 @@
class MQTTNetwork {
public:
- MQTTNetwork(NetworkInterface* aNetwork) : network(aNetwork) {
+ MQTTNetwork(NetworkInterface* aNetwork) : network(aNetwork)
+ {
socket = new TCPSocket();
+ socket->set_blocking(false);
}
~MQTTNetwork() {
@@ -14,10 +16,12 @@
}
int read(unsigned char* buffer, int len, int timeout) {
+ socket->set_timeout(timeout);
return socket->recv(buffer, len);
}
int write(unsigned char* buffer, int len, int timeout) {
+ socket->set_timeout(timeout);
return socket->send(buffer, len);
}
