亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tncnx.pas

?? 包含常用Internet協議TCP,UDP、HTTP、FTP、Telnet等
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*_* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Program:      TNCNX.PAS
Object:       Delphi component which implement the TCP/IP telnet protocol
              including some options negociations.
              RFC854, RFC885, RFC779, RFC1091
Author:       Fran鏾is PIETTE
EMail:        http://users.swing.be/francois.piette  francois.piette@swing.be
              http://www.rtfm.be/fpiette             francois.piette@rtfm.be
              francois.piette@pophost.eunet.be
Creation:     April, 1996
Version:      2.07
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1996-2000 by Fran鏾is PIETTE
              Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56
              <francois.piette@pophost.eunet.be>

              This software is provided 'as-is', without any express or
  	      implied warranty.  In no event will the author be held liable
              for any  damages arising from the use of this software.

              Permission is granted to anyone to use this software for any
              purpose, including commercial applications, and to alter it
              and redistribute it freely, subject to the following
              restrictions:

              1. The origin of this software must not be misrepresented,
                 you must not claim that you wrote the original software.
                 If you use this software in a product, an acknowledgment
                 in the product documentation would be appreciated but is
                 not required.

              2. Altered source versions must be plainly marked as such, and
                 must not be misrepresented as being the original software.

              3. This notice may not be removed or altered from any source
                 distribution.

              4. You must register this software by sending a picture postcard
                 to the author. Use a nice stamp and mention your name, street
                 address, EMail address and any comment you like to say.

Updates:
Jul 22, 1997 Adapted to Delphi 3
Sep 5, 1997  Added version information, removed old code, added OnTermType
             Renamed some indentifier to be more standard.
Sep 24, 1997 V2.03 Added procedures to negociate options
May 12, 1998 V2.04 Changed NegociateOption to properly handle unwanted
             option as Jan Tomasek <xtomasej@feld.cvut.cz> suggested.
Aug 10, 1998 V2.05 Cleared strSubOption after NegociateSubOption as Jan
             Tomasek <xtomasej@feld.cvut.cz> suggested.
Aug 15, 1999 V2.06 Moved Notification procedure to public section for
             BCB4 compatibility
Aug 20, 1999 V2.07 Added compile time options. Revised for BCB4.


 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit TnCnx;

{$B-}           { Enable partial boolean evaluation   }
{$T-}           { Untyped pointers                    }
{$X+}           { Enable extended syntax              }
{$IFNDEF VER80} { Not for Delphi 1                    }
    {$H+}       { Use long strings                    }
    {$J+}       { Allow typed constant to be modified }
{$ENDIF}
{$IFDEF VER110} { C++ Builder V3.0                    }
    {$ObjExportAll On}
{$ENDIF}
{$IFDEF VER125} { C++ Builder V4.0                    }
    {$ObjExportAll On}
{$ENDIF}

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Controls, Forms,
  WSocket, Winsock;

const
  TnCnxVersion       = 207;
  CopyRight : String = ' TTnCnx (c) 1996-2000 F. Piette V2.07 ';

  { Telnet command characters                                             }
  TNCH_EOR        = #239;     { $EF End Of Record (preceded by IAC)       }
  TNCH_SE         = #240;     { $F0 End of subnegociation parameters      }
  TNCH_NOP        = #241;     { $F1 No operation                          }
  TNCH_DATA_MARK  = #242;     { $F2 Data stream portion of a Synch        }
  TNCH_BREAK      = #243;     { $F3 NVT charcater break                   }
  TNCH_IP         = #244;     { $F4 Interrupt process                     }
  TNCH_AO         = #245;     { $F5 Abort output                          }
  TNCH_AYT        = #246;     { $F6 Are you there                         }
  TNCH_EC         = #247;     { $F7 Erase character                       }
  TNCH_EL         = #248;     { $F8 Erase line                            }
  TNCH_GA         = #249;     { $F9 Go ahead                              }
  TNCH_SB         = #250;     { $FA Subnegociation                        }
  TNCH_WILL       = #251;     { $FB Will                                  }
  TNCH_WONT       = #252;     { $FC Wont                                  }
  TNCH_DO         = #253;     { $FD Do                                    }
  TNCH_DONT       = #254;     { $FE Dont                                  }
  TNCH_IAC        = #255;     { $FF IAC                                   }

  { Telnet options                                                        }
  TN_TRANSMIT_BINARY      = #0;   { $00 }
  TN_ECHO                 = #1;   { $01 }
  TN_RECONNECTION         = #2;   { $02 }
  TN_SUPPRESS_GA          = #3;   { $03 }
  TN_MSG_SZ_NEGOC         = #4;   { $04 }
  TN_STATUS               = #5;   { $05 }
  TN_TIMING_MARK          = #6;   { $06 }
  TN_NOPTIONS             = #6;   { $06 }
  TN_DET                  = #20;  { $14 }
  TN_SEND_LOC             = #23;  { $17 }
  TN_TERMTYPE             = #24;  { $18 }
  TN_EOR                  = #25;  { $19 }
  TN_NAWS                 = #31;  { $1F }
  TN_TERMSPEED            = #32;  { $20 }
  TN_TFC                  = #33;  { $21 }
  TN_XDISPLOC             = #35;  { $23 }
  TN_EXOPL                = #255; { $FF }

  TN_TTYPE_SEND		  = #1;
  TN_TTYPE_IS		  = #0;

type
  TTnCnx = class;

  TTnSessionConnected = procedure (Sender: TTnCnx; Error : word) of object;
  TTnSessionClosed    = procedure (Sender: TTnCnx; Error : word) of object;
  TTnDataAvailable    = procedure (Sender: TTnCnx; Buffer : PChar; Len : Integer) of object;
  TTnDisplay          = procedure (Sender: TTnCnx; Str : String) of object;

  TTnCnx= class(TComponent)
  public
    Socket              : TWSocket;
  private
    FPort               : String;
    FHost               : String;
    FLocation           : String;
    FTermType           : String;
    RemoteBinMode       : Boolean;
    LocalBinMode        : Boolean;
    FLocalEcho          : Boolean;
    Spga                : Boolean;
    FTType              : Boolean;
    FBuffer             : array [0..2048] of char;
    FBufferCnt          : Integer;
    FWindowHandle       : HWND;
    FOnSessionConnected : TTnSessionConnected;
    FOnSessionClosed    : TTnSessionClosed;
    FOnDataAvailable    : TTnDataAvailable;
    FOnDisplay          : TTnDisplay;
    FOnEOR              : TNotifyEvent;
    FOnSendLoc          : TNotifyEvent;
    FOnTermType         : TNotifyEvent;
    FOnLocalEcho        : TNotifyEvent;
    procedure WndProc(var MsgRec: TMessage);
    procedure SocketSessionConnected(Sender: TObject; Error : word);
    procedure SocketSessionClosed(Sender: TObject; Error : word);
    procedure SocketDataAvailable(Sender: TObject; Error : word);
    procedure Display(Str : String);
    procedure AddChar(Ch : Char);
    procedure ReceiveChar(Ch : Char);
    procedure Answer(chAns : Char; chOption : Char);
    procedure NegociateSubOption(strSubOption : String);
    procedure NegociateOption(chAction : Char; chOption : Char);
    procedure FlushBuffer;
    function  GetState : TSocketState;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    function    Send(Data : Pointer; Len : Integer) : integer;
    function    SendStr(Data : String) : integer;
    procedure   Connect;
    function    IsConnected : Boolean;
    procedure   WillOption(chOption : Char);
    procedure   WontOption(chOption : Char);
    procedure   DontOption(chOption : Char);
    procedure   DoOption(chOption : Char);
    procedure   Notification(AComponent: TComponent; Operation: TOperation); override;
    procedure   Close;
    procedure   Pause;
    procedure   Resume;
    property    State : TSocketState                  read  GetState;
    property    Handle : HWND                         read  FWindowHandle;
  published
    property Port : String                            read  FPort
                                                      write FPort;
    property Host : String                            read  FHost
                                                      write FHost;
    property Location : String                        read  FLocation
                                                      write FLocation;
    property TermType : String                        read  FTermType
                                                      write FTermType;
    property LocalEcho : Boolean                      read  FLocalEcho
                                                      write FLocalEcho;
    property OnSessionConnected : TTnSessionConnected read  FOnSessionConnected
                                                      write FOnSessionConnected;
    property OnSessionClosed :    TTnSessionClosed    read  FOnSessionClosed
                                                      write FOnSessionClosed;
    property OnDataAvailable :    TTnDataAvailable    read  FOnDataAvailable
                                                      write FOnDataAvailable;
    property OnDisplay :          TTnDisplay          read  FOnDisplay
                                                      write FOnDisplay;
    property OnEndOfRecord :      TNotifyEvent        read  FOnEOR
                                                      write FOnEOR;
    property OnSendLoc :          TNotifyEvent        read  FOnSendLoc
                                                      write FOnSendLoc;
    property OnTermType :         TNotifyEvent        read  FOnTermType
                                                      write FOnTermType;
    property OnLocalEcho :        TNotifyEvent        read  FOnLocalEcho
                                                      write FOnLocalEcho;
  end;

procedure Register;

implementation

{$DEFINE Debug}      { Add or remove minus sign before dollar sign to }
                     { generate code for debug message output         }

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure Register;
begin
  RegisterComponents('FPiette', [TTnCnx]);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure DebugString(Msg : String);
const
    Cnt : Integer = 0;
var
    Buf : String[20];
begin
{$IFDEF Debug}
    Cnt := Cnt + 1;
    Buf := IntToHex(Cnt, 4) + ' ' + #0;
    OutputDebugString(@Buf[1]);

{$IFNDEF WIN32}
    if Length(Msg) < High(Msg) then
        Msg[Length(Msg) + 1] := #0;
{$ENDIF}

    OutputDebugString(@Msg[1]);
{$ENDIF}
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.WndProc(var MsgRec: TMessage);
begin
     with MsgRec do
         Result := DefWindowProc(Handle, Msg, wParam, lParam);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
constructor TTnCnx.Create(AOwner: TComponent);
begin
    inherited Create(AOwner);
    FWindowHandle             := AllocateHWnd(WndProc);
    FLocation                 := 'TNCNX';
    FTermType                 := 'VT100';
    FPort                     := '23';
    Socket                    := TWSocket.Create(Self);
    Socket.OnSessionConnected := SocketSessionConnected;
    Socket.OnDataAvailable    := SocketDataAvailable;
    Socket.OnSessionClosed    := SocketSessionClosed;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
destructor TTnCnx.Destroy;
begin
    if Assigned(Socket) then begin
        Socket.Free;
        Socket := nil;
    end;
    DeallocateHWnd(FWindowHandle);
    inherited Destroy;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Notification(AComponent: TComponent; Operation: TOperation);
begin
    inherited Notification(AComponent, Operation);
    if (AComponent = Socket) and (Operation = opRemove) then
        Socket := nil;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Pause;
begin
    if not Assigned(Socket) then
        Exit;
    Socket.Pause;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Resume;
begin
    if not Assigned(Socket) then
        Exit;
    Socket.Resume;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Connect;
begin
    if not Assigned(Socket) then
        Exit;

    if Socket.State <> wsClosed then
        Socket.Close;

    Socket.Proto := 'tcp';
    Socket.Port  := FPort;
    Socket.Addr  := FHost;
    Socket.Connect;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TTnCnx.IsConnected : Boolean;
begin
    Result := Socket.State = wsConnected;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Close;
begin
    if Assigned(Socket) then
        Socket.Close;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnCnx.Display(Str : String);
begin
    if Assigned(FOnDisplay) then
        FOnDisplay(Self, Str);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TTnCnx.GetState : TSocketState;
begin
    if Assigned(Socket) then
        Result := Socket.State

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频在线一区二区| 精品久久五月天| 国产一区二区三区在线看麻豆| 亚洲一区二区综合| 亚洲国产综合人成综合网站| 亚洲激情在线激情| 亚洲一级二级三级在线免费观看| 精品在线免费视频| 水野朝阳av一区二区三区| 毛片一区二区三区| 91一区二区三区在线观看| 不卡一卡二卡三乱码免费网站 | 久久男人中文字幕资源站| 一区二区三区在线免费播放| 丁香六月综合激情| 精品日韩一区二区三区免费视频| 亚洲午夜在线电影| 色综合天天综合狠狠| 欧美国产精品劲爆| 国产福利一区二区三区视频在线| 欧美一区二区三区影视| 亚洲成人av电影| 欧美综合欧美视频| 亚洲亚洲人成综合网络| 91官网在线观看| 一区二区三区欧美久久| 色综合久久中文综合久久牛| 亚洲va中文字幕| 欧美三级三级三级爽爽爽| 亚洲欧洲综合另类| 色婷婷av一区二区| 亚洲成av人在线观看| 欧美日韩国产一级片| 午夜婷婷国产麻豆精品| 欧美一区二视频| 国内一区二区在线| 国产精品色婷婷| 91美女在线观看| 亚洲高清免费一级二级三级| 欧美视频第二页| 人禽交欧美网站| 欧美成人伊人久久综合网| 国产精品资源在线看| 国产亚洲欧美一级| 白白色亚洲国产精品| 亚洲免费电影在线| 欧美一级理论片| 亚洲日本一区二区| 国产91精品久久久久久久网曝门| 日韩亚洲欧美在线| 黄色日韩网站视频| 国产欧美日韩另类视频免费观看| av亚洲精华国产精华精华| 中文字幕一区二区三区乱码在线| 在线观看亚洲专区| 免费人成精品欧美精品| 欧美国产一区视频在线观看| 色乱码一区二区三区88| 天天亚洲美女在线视频| 国产欧美视频一区二区| 91精品福利视频| 美日韩黄色大片| 中文字幕欧美一| 欧美一区二区高清| 成人高清免费观看| 精品一区二区影视| 91福利国产精品| 99久久精品国产一区| 亚洲韩国精品一区| 精品乱码亚洲一区二区不卡| 99久久久久久| 麻豆国产精品一区二区三区 | 欧美日本在线播放| 国产精品一区久久久久| 亚洲午夜一区二区| 国产精品天干天干在线综合| 欧美乱妇20p| 成人av小说网| 精品在线你懂的| 亚洲高清免费观看高清完整版在线观看| 日韩精品一区国产麻豆| 色综合久久天天| 韩国av一区二区三区四区 | 欧美日韩一区三区四区| 国产九色精品成人porny| 亚洲国产经典视频| 欧美日韩国产在线观看| 国产精品一区二区x88av| 天天影视色香欲综合网老头| 国产精品区一区二区三| 精品处破学生在线二十三| 欧美区在线观看| 在线观看亚洲a| 99精品国产视频| 国产盗摄精品一区二区三区在线 | 天天影视涩香欲综合网| 亚洲色图制服诱惑 | 五月天激情小说综合| 99久久99久久综合| 午夜伊人狠狠久久| 中文字幕中文字幕一区| 国产亚洲欧美激情| 欧美成人福利视频| 日韩视频一区二区在线观看| 欧美日韩国产在线观看| 欧美日韩一区三区| 欧美日韩视频不卡| 欧美人与性动xxxx| 欧美久久婷婷综合色| 欧美视频在线一区| 欧美性受极品xxxx喷水| 在线观看三级视频欧美| 色婷婷综合久色| 欧美在线你懂得| 欧美日韩国产三级| 在线成人高清不卡| 欧美一区二区三区日韩视频| 欧美福利一区二区| 欧美肥大bbwbbw高潮| 欧美日韩你懂的| 97久久超碰精品国产| av中文字幕一区| 在线精品视频免费播放| 欧美人xxxx| 精品国产精品网麻豆系列| 久久综合久久综合亚洲| 国产欧美一区在线| 国产精品第13页| 亚洲已满18点击进入久久| 亚洲v精品v日韩v欧美v专区| 老鸭窝一区二区久久精品| 国产综合成人久久大片91| 成人在线视频首页| 欧美中文字幕一区二区三区 | 狠狠狠色丁香婷婷综合久久五月| 国产一区二区调教| 国产成人av一区二区三区在线观看| 成人黄色片在线观看| 在线影院国内精品| 日韩精品一区二区在线| 国产欧美va欧美不卡在线| 自拍偷拍国产精品| 日韩成人伦理电影在线观看| 国产剧情在线观看一区二区| 97se狠狠狠综合亚洲狠狠| 制服.丝袜.亚洲.中文.综合| 国产亚洲欧美日韩在线一区| 亚洲自拍另类综合| 久久爱www久久做| 一本色道久久综合亚洲91| 一区二区三区在线观看欧美| 一区二区三区欧美亚洲| 麻豆精品视频在线| 91麻豆精品视频| 欧美一区二区福利在线| 国产人成亚洲第一网站在线播放| 亚洲激情网站免费观看| 麻豆免费看一区二区三区| 一本色道久久综合亚洲精品按摩| 欧美成人伊人久久综合网| 亚洲美女精品一区| 精品系列免费在线观看| 欧日韩精品视频| 国产精品国产馆在线真实露脸 | 日韩女优毛片在线| 亚洲欧美在线aaa| 国内精品写真在线观看| 欧美最新大片在线看| 国产精品网站在线播放| 久久疯狂做爰流白浆xx| 欧美日韩国产大片| 国产精品久久久久久久久免费樱桃| 亚洲精品国产一区二区精华液 | 岛国精品在线播放| 欧美一区二区三区在线视频| 亚洲天堂免费在线观看视频| 国内精品伊人久久久久av一坑| 欧美美女直播网站| 亚洲欧美日韩国产一区二区三区| 国内精品免费在线观看| 欧美一区二区在线播放| 亚洲一区在线视频| 色综合久久久久久久久久久| 久久精品视频在线免费观看| 青青草视频一区| 欧美理论片在线| 亚洲成人福利片| 欧美网站大全在线观看| 亚洲欧洲一区二区在线播放| 国产 欧美在线| 久久青草欧美一区二区三区| 久色婷婷小香蕉久久| 91精品欧美福利在线观看| 午夜久久久久久| 亚洲成av人片| 精品视频1区2区| 亚洲电影第三页| 欧美一区二区在线播放| 青青草国产精品亚洲专区无| 日韩一本二本av|