⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dninterfaces.pas

📁 一个国外比较早的IOCP控件
💻 PAS
字号:
// The contents of this file are used with permission, subject to
// the Mozilla Public License Version 1.1 (the "License"); you may
// not use this file except in compliance with the License. You may
// obtain a copy of the License at
// http://www.mozilla.org/MPL/MPL-1.1.html
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
// implied. See the License for the specific language governing
// rights and limitations under the License.
unit DnInterfaces;
interface
uses
  DnRtl;
type

  //This interface is operable for executors
  IDnIOTrackerHolder = interface
  ['{6C8AFF73-AC3D-11d5-BDA3-0000212296FE}']
    function  IsBound: Boolean;
    procedure Bind(Tracker: Pointer);
    procedure Unbind(Tracker: Pointer);
    function  Tracker: Pointer;
  end;


  //This interface is operable for TDnTcpReactor
  TDnIORequestType = (rtRead, rtWrite, rtConnect, rtClose, rtBrutalClose);

  IDnIORequest = interface
  ['{6C8AFF72-AC3D-11d5-BDA3-0000212296FE}']
    procedure Execute;
    procedure ReExecute;
    function  IsComplete: Boolean;
    function  IsCPUNeeded: Boolean;
    function  RequestType: TDnIORequestType;
  end;

  //This interface is operable for executors
  IDnIOResponse = interface
  ['{9628BEB1-AC3D-11d5-BDA3-0000212296FE}']
    function  Channel: IDnIOTrackerHolder;
    procedure CallHandler(Context: TDnThreadContext);
  end;

  IDnIOErrorValue = interface
  ['{CE303FDC-37D4-4e3c-8FC8-C77FB433605A}']
    procedure StoreError(ErrorCode: Integer);
  end;
  
  IDnChannel = interface
  ['{B022CF85-72A6-46fe-B83F-8BC8BE68B235}']
    function  RemotePort: Word;
    function  RemoteAddr: String;
    function  RemoteHost: String;
    procedure SetCustomData(D: Pointer);
    function  GetCustomData: Pointer;
    property  CustomData: Pointer read GetCustomData write SetCustomData; 
    procedure RunRequest(Request: IDnIORequest);
    function  IsClosed: Boolean;
    function  IsClosing: Boolean;
    procedure SetNagle(Value: Boolean);
  end;

  IDnImplementation = interface
  ['{C5E9DD07-6EF1-4219-AC3F-83782C36A5F1}']
    function GetImplementation: Pointer;
  end;

const
  IID_IUnknown: TGUID =             '{00000000-0000-0000-C000-000000000046}';

implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -