Add settings and slighly improve socket connection
Reconnect if settings change