socket: fix port endianness issues
Merge pull request #42 from tmatth/port_endian

socket: fix port endianness issues