Refreshed socket functions and added internal IPV6 support