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

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

?? wsocket.pas

?? 傳奇源代碼的delphi版本
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
Jun 02, 2002 V4.41 allow SOCK_RAW in Connect method for any protocol which is
             not TCP or UDP. Thanks to Holger Lembke <holger@hlembke.de>.
Jun 04, 2002 V4.42 Do not call Listen for SOCK_RAW.
             Thanks to Holger Lembke <holger@hlembke.de>.
Jun 08, 2002 V4.43 Add a dummy Register procedure for BCB1.
             Thanks to Marc-Alexander Prowe <listen@mohajer.de>.
Jul 07, 2002 V4.44 Added code in Connect method to check if socket still opened
             after OnChangeState event. If not, trigger an error WSAINVAL.
Sep 16, 2002 V4.45 Exposed RcvdPtr and RcvdCnt readonly properties.
Sep 17, 2002 V4.46 Used InterlockedIncrement/InterlockedDecrement to Inc/Dec
             socket count safely when TWSocket is used within a thread. This
             was proposed by Matthew Meadows <matthew.meadows@inquisite.com>
Sep 28, 2002 V4.47 Changed DnsLookup so that a hostname is checked for dotted
             IP addresse and resolve it numerically. Thanks to Bogdan Calin
             <soul4blade@yahoo.com> who found this bug. Alos loaded the result
             list with the address to be consistant with real lookup result.
Nov 17, 2002 V4.48 Roland Klabunde <roland.klabunde@gmx.net> found a bug in
             multicast code: listening on a specific interface was ignored.
             He fixed Listen and Connect.
Nov 27, 2002 V4.49 Added ListenBacklog property, default to 5.
Dec 17, 2002 V4.50 Moved code to virtual function to permit SSL implementation.
Jan 19, 2003 V5.00 First pre-release for ICS-SSL. New major version number
             V5.01 Gabi Slonto <buffne01@gmx.net> found a bug in DnsLookup
             when hostname was actulally a dotted IP address.
Mar 18, 2003 V5.02 Fixed WSocketIsDottedIP: reordering of boolean expressions
             involaving a string. Thanks to Ian Baker <ibaker@codecutters.org>
Apr 30, 2003 V5.03 Replaced all calls to setsockopt by calls to
             WSocket_setsockopt to avoid statically linked winsock DLL.
             Thanks to Piotr Dalek <enigmatical@interia.pl>.
             Also replaced inet_addr by WSocket_inet_addr.
Aug 27, 2003 V5.04 Marco van de Voort <marcov@stack.nl> added FreePascal (FPC)
             conditional compilation. Please contact him for any FPC support
             question.
Aug 28, 2003 V5.05 Fixed a multithreading issue related to windows class
             registration. Now using a critical section around the code.
             Thanks to Bogdan Ureche <bureche@omnivex.com> for his precious help.
Aug 31, 2003 V5.06 Added warning about deprecated procedures Synchronize,
             WaitUntilReady and ReadLine. Do not use them in new applications.
Sep 03, 2003 V5.07 Bogdan Ureche <bureche@omnivex.com> added a critical section
             to avoid problem when winsock.dll is unloaded by a thread while
             another thread is still using some TWSocket.
Sep 15, 2003 V5.08 Fixed finalization section to no free critical section if
             a TWSocket is still existing. This happend for example when a
             TWSocket is on a form and Halt is called from FormCreate event.
             Changed SendStr argument to const.
Nov 09, 2003 V5.09 Added manifest constants for Shutdown
             Added TCustomLineWSocket.SendLine method.
Jan 16, 2004 V5.10 Added "const" in front of all method using strings.
Jan 17, 2004 V5.11 Modified TriggerDataAvailable so that when in LineMode, we
             check if a line is still in the buffer of already received data.
             Also updated WMTriggerDataAvailable to avoid infinite loops.
             Introduced FLineFound to flag when a line has been found.
             See "OLD_20040117" to find this code.
Jan 21, 2004 V5.12 Checked null string in PutStringInSendBuffer and null
             pointer in PutDataInSendBuffer.
Jan 26, 2004 V5.13 Conditional compilation for BCB for constants for Shutdown.
             Reordered uses clause for FPC compatibility.
             Fixed TCustomLineWSocket.TriggerDataAvailable to deliver data
             already received while in line mode but after component user
             turned line mode off in the middle of the way. This could occur
             for example in a HTTP application where line mode is used to
             receive HTTP header line and turned off when last header line is
             found. At that point, if posted data (HTTP document) was completely
             in the same packet as the last header line, that data was not
             delivered until the next packet comes, which could never occur !
Mar 20, 2004 V5.14 Added partial support for RAW socket.
             To use RAW sockets, set Proto to 'raw_ip', 'raw_icmp', ...
             Set Port to '0' or whatever value is useful for the protocol.
             When using IP protocol, you can add option wsoSIO_RCVALL so that
             your program receive ALL datagrams when you listen on a given
             interface (You can't use 0.0.0.0).
             Do not use Connect with RAW socket. Always use Listen and then
             use SendTo to send datagrams use the socket.
             Added ReqVerHigh and ReqVerLow properties to be able to select
             which winsock version you want to load. Default to 1.1 but need
             2.2 for RAW sockets to be used.
Mar 24, 2004 V5.15 Changed WSocket_Synchronized_ResolveProto to hard code
             protocol number for tcp, udp and raw.
Jun 20, 2004 V5.16 John Mulvey <john@mulvey.eurobell.co.uk> fixed error message
             in GetPeerAddr which incorrectly reported an error about
             GetPeerName.
May 23, 2005 V5.17 PutDataInSendBuffer set bAllSent to false.
Jun 03, 2005 V5.18 Added SocketSndBufSize property which gives the size of
             winsock internal send buffer. When using TCP, you must make sure
             you never use a BufSize equal or greater than this value or
             you'll experience bad performances. See description in MSDN
             http://support.microsoft.com/default.aspx?scid=kb;en-us;823764
             Default value for BufSize is 1460 and SocketSndBufSize is 8192 so
             there is no problem when not changing those values.

About multithreading and event-driven:
    TWSocket is a pure asynchronous component. It is non-blocking and
    event-driven. It means that when you request an operation such as connect,
    the component start the operation your requested and give control back
    immediately while performing the operation in the background automatically.
    When the operation is done, an event is triggered (such as
    OnSessionConnected if you called Connect).

    This asynchronous non-blocking behaviour is very high performance but a
    little bit difficult to start with. For example, you can't call Connect and
    immediately call SendStr the line below. If you try, you'll have an
    exception triggered saying you are not connected. Calling connect will start
    connection process but will return long before connection is established.
    Calling SendStr at the next line will not work because the socket is not
    connected yet. To make it works the right way, you have to put your SendStr
    in the OnSessionConnected event.

    The asynchronous operation allows you to do several TCP/IP I/O
    simultaneously. Just use as many component as you need. Each one will
    operate independently of the other without blocking each other ! So you
    basically don't need multi-threading with TWSocket, unless YOUR processing
    is lengthy and blocking.

    If you have to use multithreading, you have two possibilities:
    1) Create your TWSocket from your thread's Execute method
    2) Attach a TWSocket to a given thread using ThreadAttach.
    In both cases, you must set MultiThreaded property to TRUE.
    If you don't use one of those methods, you'll end up with a false
    multithreaded program: all events will be processed by the main tread !
    For both methods to work, you MUST have a message loop withing your thread.
    Delphi create a message loop automatically for the main thread (it's in
    the Forms unit), but does NOT create one in a thread ! For your convenience,
    TWSocket has his own MessageLoop procedure. You can use it from your thread.

    Sample program MtSrv uses first method while ThrdSrv uses second method.
    Sample program TcpSrv is much the same as ThrdSrv but doesn't use any
    thread. You'll see that it is able to server a lot of simultaneous clients
    as well and it is much simpler.


 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit WSocket;

{$B-}              { Enable partial boolean evaluation   }
{$T-}              { Untyped pointers                    }
{$X+}              { Enable extended syntax              }
{$I ICSDEFS.INC}
{$IFDEF DELPHI6_UP}
    {$WARN SYMBOL_PLATFORM   OFF}
    {$WARN SYMBOL_LIBRARY    OFF}
    {$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
{$IFDEF COMPILER2_UP}{ Not for Delphi 1                    }
    {$H+}            { Use long strings                    }
    {$J+}            { Allow typed constant to be modified }
{$ENDIF}
{$IFDEF BCB3_UP}
    {$ObjExportAll On}
{$ENDIF}

{ If NO_ADV_MT is defined, then there is less multithread code compiled.    }
{$IFDEF DELPHI1}
    {$DEFINE NO_ADV_MT}
{$ENDIF}

interface

uses

  Messages,
{$IFDEF USEWINDOWS}
  Windows,
{$ELSE}
  WinTypes, WinProcs,
{$ENDIF}
  Classes, SysUtils,
{$IFNDEF NOFORMS} { See comments in history at 14/02/99 }
  Forms,
{$ENDIF}
{ You must define USE_SSL so that SSL code is included in the component.    }
{ To be able to compile the component, you must have the SSL related files  }
{ which are _NOT_ freeware. See http://www.overbyte.be for details.         }
{$IFDEF USE_SSL}
  IcsSSLEAY, IcsLIBEAY, IcsSslBuffer, IcsSslConnector,
{$ENDIF}
  WSockBuf, WinSock;

{var
  LogStream : TFileStream;}

const
  WSocketVersion            = 518;
  CopyRight    : String     = ' TWSocket (c) 1996-2005 Francois Piette V5.18 ';
  WM_ASYNCSELECT            = WM_USER + 1;
  WM_ASYNCGETHOSTBYNAME     = WM_USER + 2;
  WM_ASYNCGETHOSTBYADDR     = WM_USER + 3;
  WM_CLOSE_DELAYED          = WM_USER + 4;
  WM_WSOCKET_RELEASE        = WM_USER + 5;
  WM_TRIGGER_EXCEPTION      = WM_USER + 6;
  WM_TRIGGER_DATA_AVAILABLE = WM_USER + 20;
  WSA_WSOCKET_TIMEOUT       = 12001;
{$IFNDEF BCB}
  { Manifest constants for Shutdown }
  SD_RECEIVE                = 0;
  SD_SEND                   = 1;  { Use this one for graceful close }
  SD_BOTH                   = 2;
{$ENDIF}
{$IFDEF WIN32}
  winsocket  = 'wsock32.dll';      { 32 bits TCP/IP system DLL }
  winsocket2 = 'ws2_32.dll';       { 32 bits TCP/IP system DLL version 2}
{$ELSE}
  winsocket = 'winsock.dll';      { 16 bits TCP/IP system DLL }
{$ENDIF}

type

  TWndMethod         = procedure(var Message: TMessage) of object;
  ESocketException   = class(Exception);
  TBgExceptionEvent  = procedure (Sender : TObject;
                                  E : Exception;
                                  var CanClose : Boolean) of object;

  TSocketState       = (wsInvalidState,
                        wsOpened,     wsBound,
                        wsConnecting, wsSocksConnected, wsConnected,
                        wsAccepting,  wsListening,
                        wsClosed);
  TSocketSendFlags   = (wsSendNormal, wsSendUrgent);
  TSocketLingerOnOff = (wsLingerOff, wsLingerOn, wsLingerNoSet);
  TSockAddr          = Winsock.TSockAddr;

  TDataAvailable     = procedure (Sender: TObject; ErrCode: Word) of object;
  TDataSent          = procedure (Sender: TObject; ErrCode: Word) of object;
  TSendData          = procedure (Sender: TObject; BytesSent: Integer) of object;
  TSessionClosed     = procedure (Sender: TObject; ErrCode: Word) of object;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩麻豆91| 亚洲综合无码一区二区| 国产精品天美传媒| 亚洲国产毛片aaaaa无费看 | 一区二区三区免费| 国产一区不卡精品| 欧美日韩黄色一区二区| 日韩欧美精品三级| 亚洲欧美经典视频| 国产成人免费在线| 精品久久久久久久久久久久久久久久久 | 中文字幕亚洲区| 精品亚洲成av人在线观看| 欧美色综合网站| 最新热久久免费视频| 国产剧情一区在线| 精品理论电影在线观看| 日韩在线卡一卡二| 欧美性淫爽ww久久久久无| 中文字幕欧美三区| 国产精品白丝av| 久久综合丝袜日本网| 日本视频一区二区| 777精品伊人久久久久大香线蕉| 亚洲男人的天堂一区二区| 成人美女视频在线看| 久久久综合视频| 国产一区二区三区免费在线观看| 欧美一级专区免费大片| 婷婷中文字幕一区三区| 欧美日韩免费观看一区三区| 亚洲影视在线播放| 欧美视频中文一区二区三区在线观看 | 在线观看成人小视频| 亚洲欧美一区二区三区极速播放| www.亚洲色图.com| 中文字幕亚洲精品在线观看| 91在线精品一区二区三区| 中文字幕在线一区| 91碰在线视频| 亚洲卡通动漫在线| 欧美影院一区二区| 日韩在线一区二区| 精品国产污网站| 国产**成人网毛片九色| 国产精品乱人伦一区二区| 99re亚洲国产精品| 午夜精品视频在线观看| 91精品国产aⅴ一区二区| 免费精品视频最新在线| 精品国产亚洲在线| 成人黄页毛片网站| 亚洲国产精品精华液网站| 欧美丰满少妇xxxxx高潮对白| 免费在线观看日韩欧美| 精品盗摄一区二区三区| 丰满岳乱妇一区二区三区| 亚洲精品视频在线| 7878成人国产在线观看| 国产在线播放一区三区四| 国产精品盗摄一区二区三区| 精品1区2区3区| 精品一区二区免费| 亚洲另类在线一区| 欧美成人乱码一区二区三区| 成人精品小蝌蚪| 午夜欧美2019年伦理| 久久综合九色综合欧美98| 成人国产一区二区三区精品| 亚洲一区自拍偷拍| 精品国产麻豆免费人成网站| 91蜜桃在线免费视频| 亚洲欧美在线视频| 欧美一区二区啪啪| 国产xxx精品视频大全| 一二三四社区欧美黄| 欧美电影免费观看高清完整版在线观看| 国产一区二区三区在线观看免费视频| 日韩一区中文字幕| 日韩精品中文字幕在线一区| gogogo免费视频观看亚洲一| 日韩精品免费专区| 中文字幕一区二| 日韩视频永久免费| 91成人在线精品| 黄页视频在线91| 亚洲va欧美va人人爽午夜| 国产亲近乱来精品视频| 99在线精品免费| 亚洲精品免费看| 久久综合久久综合久久综合| 精品视频在线免费观看| 成人久久视频在线观看| 狠狠网亚洲精品| 国产一区二区在线电影| 亚洲男帅同性gay1069| 国产日韩欧美一区二区三区乱码 | 欧洲精品中文字幕| 成人在线一区二区三区| 毛片基地黄久久久久久天堂| 亚洲狠狠爱一区二区三区| 国产精品传媒在线| 中文字幕欧美激情| 久久伊99综合婷婷久久伊| 欧美久久久久久久久| 在线观看亚洲精品| 91福利精品第一导航| 97久久久精品综合88久久| 丁香六月综合激情| 欧美va亚洲va| 久久超碰97中文字幕| 久久先锋影音av鲁色资源网| 欧美卡1卡2卡| 欧美日韩精品一区二区在线播放 | 床上的激情91.| 国产乱对白刺激视频不卡| 日本亚洲三级在线| 久久狠狠亚洲综合| 老司机精品视频导航| 久久国产精品99久久久久久老狼 | 日本成人在线看| 美洲天堂一区二卡三卡四卡视频 | 夜夜嗨av一区二区三区中文字幕 | 一区二区三区在线观看网站| 亚洲精品免费电影| 亚洲视频综合在线| 亚洲精品日韩专区silk| 亚洲欧美视频在线观看| ww亚洲ww在线观看国产| 亚洲精品在线网站| 欧美激情一区二区三区| 国产精品国产三级国产aⅴ无密码| 国产精品成人免费| 亚洲成人你懂的| 天堂va蜜桃一区二区三区漫画版| 久久久久久久性| 国产清纯白嫩初高生在线观看91 | 亚洲成人你懂的| 亚洲成人免费影院| 日韩精品国产精品| 国产一区日韩二区欧美三区| 成人性生交大片免费| 在线精品视频免费播放| 日韩av午夜在线观看| 中文字幕中文字幕在线一区| 亚洲国产欧美在线人成| 久色婷婷小香蕉久久| 成人99免费视频| 欧美日韩电影在线播放| 久久久国产精华| 亚洲小说欧美激情另类| 国产美女精品在线| 色偷偷88欧美精品久久久 | 成人黄色网址在线观看| 欧美日韩国产中文| 国产欧美日韩在线看| 亚洲大尺度视频在线观看| 国产精品18久久久久久久网站| 一本到不卡精品视频在线观看 | 极品少妇xxxx偷拍精品少妇| 99精品视频一区二区三区| 91精品久久久久久久91蜜桃| 欧美国产在线观看| 日韩成人一区二区三区在线观看| 成人激情免费视频| 欧美一级日韩免费不卡| 亚洲视频一区二区在线观看| 国产精品美女久久久久久久| 喷水一区二区三区| 91久久精品一区二区三区| 国产人成亚洲第一网站在线播放| 亚洲一区中文日韩| 午夜精品一区二区三区免费视频 | 99久久婷婷国产综合精品| 国产高清精品久久久久| 欧美午夜在线一二页| 国产婷婷一区二区| 日本在线不卡视频一二三区| 成人黄色免费短视频| 91精品国产入口| 亚洲黄一区二区三区| 国产精品一区免费视频| 欧美日韩亚洲国产综合| 国产精品久久久久国产精品日日| 奇米一区二区三区av| 欧美日韩和欧美的一区二区| 亚洲男人都懂的| a在线播放不卡| 国产欧美一区二区在线| 久久精品国产免费| 日韩一区二区麻豆国产| 午夜精品久久久久久久久久| 91福利国产精品| 亚洲天堂成人在线观看| 国产精品一卡二| 久久久国产一区二区三区四区小说 | 99精品视频在线观看免费| 国产午夜精品久久久久久免费视| 国产一区视频导航| 久久精品人人做人人综合|