Renamed socket functions to match with C style conventions