TCP connect working, close almost working