Init local_ip and local_port properly in mg_connection