test whether connection is open