implementation of tcp_info and udp_info. use socket to get the right int for the ip