Code: Select all
while (syslogQueue != NULL) {
DBG_SYSLOG("syslog_udp_send: %s\n", syslogQueue->msg);
espconn.proto.udp->remote_port = syslogHost.port; // ESP8266 udp remote port
os_memcpy(&syslog_espconn.proto.udp->remote_ip, &syslogHost.addr.addr, 4); // ESP8266 udp remote IP
DBG_SYSLOG("*** before %s\n", "espconn_send");
res = espconn_sendto(&syslog_espconn, (uint8_t *)syslogQueue->msg, len);
DBG_SYSLOG("*** after %s\n", "espconn_send");
}
udp_sent_cb gets triggered BEFORE espconn_sendto returns to the caller, so I can't use it as indicator:
Code: Select all
100592> syslog_udp_send: host=192.168.254.216:514
100596> syslog_udp_send: <13> - ems-link02 esp-link 0.186084 6 initializing MQTT
100603> *** before espconn_send
100606> syslog_udp_sent_cb: 0x3fff2d30
100609> *** after espconn_send
100612> syslog_udp_send: <13> - ems-link02 esp-link 0.197466 7 initializing user application
100620> *** before espconn_send
100623> syslog_udp_sent_cb: 0x3fff2d30
100627> *** after espconn_send
100629> syslog_udp_send: <13> - ems-link02 esp-link 0.209266 8 waiting for work to do...
100637> *** before espconn_send
100640> syslog_udp_sent_cb: 0x3fff2d30
100644> *** after espconn_send
100646> syslog_udp_send: <13> - ems-link02 esp-link 40.475910 9 Accept port 23, conn=3fff7600, pool slot 0
100657> *** before espconn_send
100663> *** after espconn_send
100666> syslog_udp_send: <13> - ems-link02 esp-link 100.585642 10 Accept port 23, conn=3fff6298, pool slot 0
(numbers at the beginning of line are ms since boot)
Any other suggestions than gating the messages with os_timer_*?