Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Mosquitto Fail to send large data to websockets

I want to send large data (40MB) to websockets but mosquitto does not complete the entire file because an unknown reason. Mosquitto starts sending but after a few packets it stops. The same thing works under normal mosquitto_sub.

I am finding out the reason of why suddenly stops sending, I found the function "_mosquitto_write_bytes"

but I can't undestand how does it make that work. I had similar issue in python with send() and sendall()

#file: net_mosq.c

void _mosquitto_write_bytes(struct _mosquitto_packet *packet, const void *bytes, uint32_t count)
{
    _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Testing( %d )", count);

    assert(packet);
    assert(packet->pos+count <= packet->packet_length);

    memcpy(&(packet->payload[packet->pos]), bytes, count);
    packet->pos += count;
}

Where is the socket.send() ??


Regards.

Manuel





Back to the top