Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NNTP connect to server
#6
(01-04-2020, 01:18 PM)AndrzejB Wrote: But I havent IPVersion

Known issueTIdNNTP 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;

Reply


Messages In This Thread
NNTP connect to server - by AndrzejB - 12-25-2019, 02:36 PM
RE: NNTP connect to server - by rlebeau - 12-29-2019, 11:58 PM
RE: NNTP connect to server - by AndrzejB - 01-03-2020, 07:26 PM
RE: NNTP connect to server - by rlebeau - 01-03-2020, 10:57 PM
RE: NNTP connect to server - by AndrzejB - 01-04-2020, 01:18 PM
RE: NNTP connect to server - by rlebeau - 01-06-2020, 11:32 PM
RE: NNTP connect to server - by AndrzejB - 01-07-2020, 11:04 AM
RE: NNTP connect to server - by rlebeau - 01-07-2020, 07:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)