adding tcp connection callbacks in http server loop