Setting up socket connection.