The definition you gave is for a non-connectedtopological.space

The operative word there is space.

So the example that you give is not a connected space.

In with the usual topology thesetis connected.

Yes, the concept of disconnectedness depends upon the topology.