broken down socket setup. started method for processing messages