Adding the ability to set keepaliveinterval and atempt socket reconnect
on exception in _send_data