Commit db5f42c5 authored by Axel Auweter's avatar Axel Auweter
Browse files

Cleanups...

parent b0f24fae
......@@ -345,9 +345,9 @@ void SimpleMQTTServerMessageThread::assignConnection(int newsock)
fdsMtx.lock();
for (int i=0; i<SimpleMQTTConnectionsPerThread; i++) {
if (fds[i].fd == -1) {
fds[i].fd = newsock;
fds[i].events = POLLIN | POLLPRI | POLLHUP;
fds[i].revents = 0;
fds[i].fd = newsock;
numConnections++;
......@@ -398,6 +398,12 @@ SimpleMQTTServerMessageThread::SimpleMQTTServerMessageThread(SimpleMQTTMessageCa
*/
memset(fds, -1, sizeof(fds));
/*
* Clear the msg array. Warning: This will only work when the
* size of the msg array is determined at compile time.
*/
memset(msg, 0, sizeof(msg));
/*
* Initialize the number of active connections to 0 and set
* the messageCallback function.
......
......@@ -8,8 +8,6 @@
#ifndef SIMPLEMQTTSERVERTHREAD_H_
#define SIMPLEMQTTSERVERTHREAD_H_
#define MQTT_INVALID_SOCKET -1
class SimpleMQTTServerThread
{
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment