(01-04-2020, 01:18 PM)AndrzejB Wrote: But I havent IPVersion
Known issue. TIdNNTP derives from TIdTCPClientCustom rather than TIdTCPClient. The IPVersion property is declared as protected in TIdTCPClientCustom but is published in TIdTCPClient.
(01-04-2020, 01:18 PM)AndrzejB Wrote: IdNNTP1.Socket.IPVersion:=Id_IPv6
but this is bad
--> I move IPVersion from protected to public
You need to set the TIdNNTP.IPVersion property, not the TIdNNTP.Socket.IPVersion property, as Connect() will overwrite the Socket.IPVersion before creating the TCP socket.
If you are creating the TIdNNTP object at design-time, you can use an accessor class at runtime to reach the protected TIdNNTP.IPVersion property, eg:
Code:
type
TIdNNTPAccess = class(TIdNNTP)
end;
TIdNNTPAccess(IdNNTP1).IPVersion := Id_IPv6;If you are creating the TIdNNTP object yourself at runtime, you can derive from TIdNNTP and promote the IPVersion property, eg:
Code:
type
TMyIdNNTP = class(TIdNNTP)
public
property IPVersion;
end;
var
IdNNTP1: TMyIdNNTP;
IdNNTP1 := TMyIdNNTP.Create(Self);
IdNNTP1.IPVersion := Id_IPv6;
