Refactored mdns_socket(), mdns_close()