Removed code that declared extra int variable. Now sock will be of int datatype for unix based systems