Replaced deprecated bindSocket call with bind