openLuup.server : getting tcp socket error messages


While I keep working on new versions of my Domoticz plugin, I realized there is one outstanding very minor issue that I am faced with in my openLuup logs…

when calling a registered http handler function in my plugin from a client system/application through a “curl” or “wget”, I keep getting tcp closed errors logged by the openLuup server

2016-12-09 18:52:19.490 openLuup.server:: new client connection from tcp{client}: 0x1aff180 2016-12-09 18:52:19.490 openLuup.server:: GET /data_request?id=lr_DZUpdate&idx=48 HTTP/1.1 tcp{client}: 0x1aff180 [request is processed by my registered handler] 2016-12-09 18:52:19.497 openLuup.server:: request completed (42 bytes, 1 chunks, 6 ms) tcp{client}: 0x1aff180 2016-12-09 18:52:19.497 openLuup.server:: receive error: closed tcp{client}: 0x1aff180
while calling the same url from Chrome or from a lua http function yields no error from the openLuup server

2016-12-09 18:58:54.035 openLuup.server:: new client connection from tcp{client}: 0x19ce408 2016-12-09 18:58:54.139 openLuup.server:: GET /data_request?id=lr_DZUpdate&idx=48 HTTP/1.1 tcp{client}: 0x19ce408 [request is processed by my registered handler] 2016-12-09 18:58:54.152 openLuup.server:: request completed (42 bytes, 1 chunks, 12 ms) tcp{client}: 0x19ce408 [other stuff not relevant happens] 2016-12-09 18:51:17.533 openLuup.server:: closing client connection: tcp{client}: 0x19ce408

I am not proficient at all in network issues, but I suspect the errors probably stem that when a curl or wget process ends its kills the relevant connection, while the openLuup server is designed to end these by itself… If I am right in my analysis, is there a specific reason for that ?

My http calls are properly handled so it does not matter too much, if it were not for the optics of seeing all these errors in my logs…

Yes, I wouldn’t worry about it, but I admit it looks bad. Perhaps I should just change the ‘error’ message.

It is to do with closing the connection properly, but it may be that I’m not acting the HTTP headers in the correct way. The default behavior for the openLuup server is to keep an initial connection open so that additional requests may be handled from the same client. However, some clients simply open and close connections every request.

Thanks @akbooer. that’s what I thought… no worries, I think we can all live with the error messages then

I get these errors frequently although they have decreased as my system has added devices. Not sure why - perhaps there is enough activity that timeouts don’t occur. I do know that the Raspberry Pi Bluetooth scanner causes this error very frequently so it is a good test case to debug further if desired. I do not see any issue other than the message in the log; otherwise everything seems to work fine.