End the connection when the connect flags reserved is set
Refactored the Handler functions