首页 > 其他分享 >Delphi IdTCPClient[1] 介绍、属性、方法

Delphi IdTCPClient[1] 介绍、属性、方法

时间:2022-11-21 11:02:22浏览次数:44  
标签:const string read Delphi overload IdTCPClient Integer procedure 属性

Delphi IdTCPClient[1] 介绍、属性、方法

1、介绍

实现TCP客户端。TIdTCPClient封装了一个完整的TCP(传输控制协议)客户端,包括socks支持。TIdTCPClient可以用作特定协议实现的祖先类。许多Indy客户端组件,如TIdDayTime、TIdEcho、TIdFinger、TIdFTP、TIdGopher、TIdPHTTP、TIdNNTP、TIdPOP3、TIdQUOT、TIdSMTP、TIdTelnet和TIdWhois都是TIdTCPClient的后代

unit IdTCPClient;

interface

uses
  Classes, IdStack,
  IdException, IdGlobal, IdTCPConnection;

const
  BoundPortDefault = 0;

type
  TIdTCPClient = class(TIdTCPConnection)
  protected
    FBoundIP: string;
    FBoundPort: Integer;
    FBoundPortMax: Integer;
    FBoundPortMin: Integer;
    FHost: string;
    FOnConnected: TNotifyEvent;
    FPassword: string;
    FPort: integer;
    FUsername: string;
    //
    procedure SetHost(const Value: string); virtual;
    procedure SetPort(const Value: integer); virtual;
    procedure DoOnConnected; virtual;
    //
    property Username: string read FUsername write FUsername;
    property Password: string read FPassword write FPassword;
  public
    procedure Connect(const ATimeout: Integer = IdTimeoutDefault); virtual;
    function ConnectAndGetAll: string; virtual;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    //
    property BoundPortMax: Integer read FBoundPortMax write FBoundPortMax;
    property BoundPortMin: Integer read FBoundPortMin write FBoundPortMin;
  published
    property BoundIP: string read FBoundIP write FBoundIP;
    property BoundPort: Integer read FBoundPort write FBoundPort default BoundPortDefault;
    property Host: string read FHost write SetHost;
    property OnConnected: TNotifyEvent read FOnConnected write FOnConnected;
    property Port: integer read FPort write SetPort;
  end;

implementation

uses
  IdComponent, IdIOHandlerSocket, IdResourceStrings,
  SysUtils;

2、属性:

  • BoundIP
  • BoundPort
  • BoundPortMax
  • BoundPortMin
  • Host
  • OnConnected
  • Port

TIdTCPConnection

  • ASCIIFilter
  • ClosedGracefully
  • Greeting
  • InputBuffer
  • Intercept
  • IOHandler
  • LastCmdResult
  • MaxLineAction
  • MaxLineLength
  • OnDisconnected
  • OnWork
  • OnWorkBegin
  • OnWorkEnd
  • ReadLnSplit
  • ReadLnTimedOut
  • ReadTimeout
  • RecvBufferSize
  • SendBufferSize
  • Socket

TIdComponent

  • LocalName

TIdBaseComponent

  • Version

3、方法

TIdTCPClient

  • Connect
  • ConnectAndGetAll
  • Create
  • Destroy

TIdTCPConnection

  • AllData
  • CancelWriteBuffer
  • procedure Capture(ADest: TStream; const ADelim: string = '.'; const AIsRFCMessage: Boolean = True); overload;
  • procedure Capture(ADest: TStream; out VLineCount: Integer; const ADelim: string = '.'; const AIsRFCMessage: Boolean = True); overload;
  • procedure Capture(ADest: TStrings; const ADelim: string = '.'; const AIsRFCMessage: Boolean = True); overload;
  • procedure Capture(ADest: TStrings; out VLineCount: Integer; const ADelim: string = '.'; const AIsRFCMessage: Boolean = True); overload;
  • CheckForDisconnect
  • CheckForGracefulDisconnect
  • CheckResponse
  • ClearWriteBuffer
  • CloseWriteBuffer
  • Connected
  • Create
  • CurrentReadBuffer
  • Destroy
  • Disconnect
  • DisconnectSocket
  • FlushWriteBuffer
  • GetInternalResponse
  • function GetResponse(const AAllowedResponses: array of SmallInt): SmallInt; virtual; overload;
  • function GetResponse(const AAllowedResponse: SmallInt): SmallInt; overload;
  • InputLn
  • OpenWriteBuffer
  • procedure RaiseExceptionForLastCmdResult; virtual; overload;
  • procedure RaiseExceptionForLastCmdResult(AException: TClassIdException); virtual; overload;
  • ReadBuffer
  • ReadCardinal
  • ReadChar
  • ReadFromStack
  • ReadInteger
  • ReadLn
  • ReadLnWait
  • ReadSmallInt
  • ReadStream
  • ReadString
  • ReadStrings
  • function SendCmd(const AOut: string; const AResponse: SmallInt = -1): SmallInt; overload;
  • function SendCmd(const AOut: string; const AResponse: Array of SmallInt): SmallInt; virtual; overload;
  • WaitFor
  • Write
  • WriteBuffer
  • WriteCardinal
  • WriteFile
  • WriteHeader
  • WriteInteger
  • WriteLn
  • WriteRFCReply
  • WriteRFCStrings
  • WriteSmallInt
  • WriteStream
  • WriteStrings

TIdComponent

  • BeginWork
  • Create
  • Destroy
  • DoWork
  • EndWork

TIdBaseComponent

  • GetVersion

4、事件

  • OnStatus     //OnStatus是当前连接状态更改时触发的TIdStatusEvent事件处理程序。OnStatus由DoStatus方法触发,该方法提供事件处理程序使用的参数。axStatus是当前连接的TIdStatus值。aaArgs是Format函数的可选参数,用于构造表示当前连接状态的文本消息。

 

 

 

 

创建时间:2022.11.21  更新时间:

标签:const,string,read,Delphi,overload,IdTCPClient,Integer,procedure,属性
From: https://www.cnblogs.com/guorongtao/p/16910688.html

相关文章

  • 111:特殊属性
    Python对象中包含了很多双下划线开始和结束的属性,这些是特殊属性,有特殊用法。这里我们列出常见的特殊属性:#测试特殊属性classA:passclassB:passcl......
  • Vue笔记 - 计算属性(computed)和监视属性(watch)
    计算属性和监视属性目录计算属性和监视属性1.计算属性2.监视属性2.1深度监视3.computed和watch对比1.计算属性定义:使用的属性起初并不存在,要通过已有属性计算得......
  • Vue3组件Props属性名不能与Setup()中变量名不可重复
    npmrunlint,显示错误点:30:9   error Gettingavaluefromthe`props`inrootscopeof`setup()`willcausethevaluetolosereactivity vue/no-setup-pr......
  • C# WPF 测试直接绑定依赖属性双向传递是没有问题的
    续这篇测试:https://www.cnblogs.com/huvjie/p/16909290.html测试页面:<Windowx:Class="MyWPFSimple3.MainWindow"xmlns="http://schemas.microsoft.com/winfx/......
  • css文本属性
    文字题颜色设置:文本对齐:text-align (left  center  right )文本装饰:text-decoration  (underline   overline   line-through)文本缩进:text-intend:10p......
  • 电脑文件夹下怎么不显示文件数目及属性?
    https://zhidao.baidu.com/question/2019922642324390228.html1、点击左上角的【组织】按钮,如下图所示,然后进入下一步。2、然后,在组织下拉菜单栏中,点击布局右侧的细节窗......
  • 98:私有属性
    Python对于类的成员没有严格的访问控制限制,这与其他面向对象语言有区别。关于私有属性和私有方法,有如下要点:1.通常我们约定,两个下划线开头的属性是私有的(private)。其他......
  • 93:类属性_内存分析创建类和对象的底层
    类属性是从属于“类对象”的属性,也称为“类变量”。由于,类属性从属于类对象,可以被所有实例对象共享。类属性的定义方式:  class类名:    类变量名=初始值在类中或......
  • 90:实例属性_内存分析
    ###实例属性和实例方法###实例属性实例属性是从属于实例对象的属性,也称为“实例变量”。他的使用有如下几个要点:1.实例属性一般在__init__()方法中通过如下代码定义:  ......
  • 传奇GM调整极品属性的命令-----技术分享
    传奇架设GM调整极品属性的命令GM命令@supermake命令用法!以下格式皆为@supermakeabc以上命令含义:调整A(装备)的B(属性)到C(点数)@supermake10101代表武器0代......