Only send data if connection is open.