i can't publish ios app appstore.
delphi 10.1.2 berlin, ios64, win 8.1.
i received next info apple:
thank response.
please ensure app compatible ipv6 networks.
the easiest way test app ipv6 compatibility set local ipv6 network on mac. can connect network ios devices test ipv6 compatibility.
please follow step-by-step instructions provided in supporting ipv6 dns64/nat64 networks.
for additional information supporting ipv6 networks, please review supporting ipv6-only networks.
it's connection code.
if (fsocket<>nil) begin if not fsocket.connected begin setstate(mwtrstdisconnected); fsocket.free; fsocket:=nil; end else exit; end; fsocket:=tidtcpclient.create(nil); fsocket.host:=fhost; fsocket.port:=fport; //checkcode {$ifdef kbmmw_using_indy_9_or_newer} fsocket.boundportmin:=fminclientport; fsocket.boundportmax:=fmaxclientport; {$endif} {$ifdef kbmmw_using_indy_10} fsocket.readtimeout:=requesttimeout*1000; fsocket.connecttimeout:=connecttimeout*1000; {$endif} {$ifdef kbmmw_using_indy_8_00_23} fsocket.connect; {$else} {$ifdef kbmmw_using_indy_9} fsocket.connect(connecttimeout*1000); {$else} fsocket.connect; {$endif} {$endif} doconnected(info);
in opinion have insert next code in //checkcode place.
tidstack.incusage; iduri := tiduri.create('195.34.x.x'); try try ss := gstack.resolvehost(iduri.host, tidipversion.id_ipv6); iduri.ipversion := tidipversion.id_ipv6; except iduri.ipversion := tidipversion.id_ipv4; // in case. end; //showmessage(ss); freeandnil(iduri); tidstack.decusage; end;
but code (gstack.resolvehost) doesn't work on ios.
how solve it?
try more instead:
fsocket := tidtcpclient.create(nil); fsocket.host := fhost; fsocket.port := fport; {$ifdef kbmmw_using_indy_9_or_newer} fsocket.boundportmin := fminclientport; fsocket.boundportmax := fmaxclientport; {$endif} {$ifdef kbmmw_using_indy_10} fsocket.readtimeout := requesttimeout*1000; fsocket.connecttimeout := connecttimeout*1000; // check if connecting ipv4/ipv6 address directly... if gstack.isip(fhost) // checks ipv4 right begin fsocket.ipversion := id_ipv4; fsocket.connect; end else if makecanonicalipv6address(fhost) <> '' begin fsocket.ipversion := id_ipv6; fsocket.connect; end else begin // connecting hostname, try ipv6 first, fallback ipv4... try fsocket.ipversion := id_ipv6; fsocket.connect; except fsocket.ipversion := id_ipv4; fsocket.connect; end; end; {$else} // ipv4 supported... {$ifdef kbmmw_using_indy_9} fsocket.connect(connecttimeout*1000); {$else} fsocket.connect; {$endif} {$endif} doconnected(info);
alternatively:
var lipaddress: tidipaddress; llocalips: tidstacklocaladdresslist; tryipv4, tryipv6: boolean; i: integer; ... fsocket := tidtcpclient.create(nil); fsocket.host := fhost; fsocket.port := fport; {$ifdef kbmmw_using_indy_9_or_newer} fsocket.boundportmin := fminclientport; fsocket.boundportmax := fmaxclientport; {$endif} {$ifdef kbmmw_using_indy_10} fsocket.readtimeout := requesttimeout*1000; fsocket.connecttimeout := connecttimeout*1000; lipaddress := tidipaddress.makeaddressobject(fhost); if lipaddress <> nil begin // connecting ipv4/ipv6 address... fsocket.ipversion := lipaddress.addrtype; lipaddress.free; fsocket.connect; end else begin // connecting hostname... tryipv4 := false; tryipv6 := false; llocalips := tidstacklocaladdresslist.create; try gstack.getlocaladdresslist(llocalips); := 0 llocalips.count-1 begin case llocalips[i].ipversion of id_ipv4: tryipv4 := true; id_ipv6: tryipv6 := true; end; end; list.free; end; if tryipv6 begin try fsocket.ipversion := id_ipv6; fsocket.connect; tryipv4 := false; except if not tryipv4 raise; end; end; if tryipv4 begin fsocket.ipversion := id_ipv4; fsocket.connect; end; if not (tryipv4 or tryipv6) raise exception.create('not connected ipv4 or ipv6 network'); end; {$else} // ipv4 supported... {$ifdef kbmmw_using_indy_9} fsocket.connect(connecttimeout*1000); {$else} fsocket.connect; {$endif} {$endif} doconnected(info);
note situation become simpler handle once indy implements following feature, ways off, think:
support round-robin dns (support connecting ipv4/ipv6 hostnames)
Comments
Post a Comment