Initiate socket connection earlier