Sock deprecated function fix

Some of the functions in sock.cpp are deprecated and removed on some
compilers (even GCC), switch these to ISO-standard ones.