remove persistent connection, check socket before read/write