Use stream_get_meta_data for connection check