Replaced += with AddAppender and -= with RemoveAppender
Checking if socket is connected, before sending