Check If Socket Is Connected Python