Closed Tieske closed 1 year ago
When conn.sock is a luasec connection instance - it does not have the :shutdown() method AFAIK
ah, but the method is available. Sockets are just transparent wrappers around luasocket sockets, so it should have it.
Just isn't documented.
oops... you're right. looked at the close method, but indeed the shutdown is missing. My bad.
Please note that "close" and "shutdown" can do similar things for plain socket, and completely different actions for SSL sockets. AFAIK, "shutdown" means "do SYN/FIN packets handshake to indicate connection closing", and "close" is just hung up socket on client side. But it's possible that for SSL socket the "close" method is doing the SSL+network handshake, leading to collision with "shutdown"
for now I just updated all to 'close', not perfect but will do I guess.
the luasocket connector uses
shutdown
; https://github.com/xHasKx/luamqtt/blob/eacac48e31aa1a58974ef05d76687d8554a33207/mqtt/luasocket.lua#L22the luasec based luasocket_ssl connector however uses
close
; https://github.com/xHasKx/luamqtt/blob/eacac48e31aa1a58974ef05d76687d8554a33207/mqtt/luasocket_ssl.lua#L45is there a reason behind these asymmetrical calls?