Class Tmsocket (unit FTPSock)

Inherits from

TComponent

Constructors


constructor Create(AOwner: TComponent);



Functions

procedure Accept(ListeningSocket: Tmsocket);


procedure Connect;


procedure CreateICMPSocket;


procedure CreateTCPSocket;


destructor Destroy;


procedure Disconnect;


procedure FillAddress(address: string);


procedure FillName;


procedure FillPort(port: word);


function GetAddressString: string;


function GetLocalAddress: string;


function GetLocalHost: string;


function GetLocalPort: u_short;


function InitializeWinsock: Boolean;


procedure Listen;


function LoadWinsock(wsPath: string): Boolean;


procedure LookupName(host: string);


function RecvBuf(buf: PChar; cnt: integer): integer;


function SendBuf(buf: PChar; cnt: integer): integer;


function SendBufOOB(buf: PChar; cnt: integer): integer;


procedure SetServer(s: string);


procedure SetTimeout(seconds: LongInt);

end session bug

procedure ShutdownWinsock;


procedure UnloadWinsock;


procedure AcceptReady;


procedure Connected;


procedure Disconnected;


procedure LookupNameDone;


procedure ReadReady;


procedure WriteReady;


procedure SockWndProc(var Message: TMessage);


Properties

property Port : u_short


property Server : string


property CustomMessage : TSSWndMethod


property Description : string


property Handle : HWND


property IsConnected : Boolean


property MaxSockets : integer


property Socket : TSock


property SystemStatus : string


property TimeOutArp : LongInt


property TimeOutConnect : LongInt


property TimeOutTransaction : LongInt


property Version : string


property WinsockInitialized : Boolean


property WinsockLoaded : Boolean


Events

event OnAccept : TNotifyEvent


event OnConnected : TNotifyEvent


event OnDisconnected : TNotifyEvent


event OnLookupNameDone : TNotifyEvent


event OnReadReady : TNotifyEvent


event OnTimeOut : TNotifyEvent


event OnWriteReady : TNotifyEvent


Variables

Address : string;


FPort : u_short;


FServer : string;


Host : string;


LastError : word;


FVersion : string;


ArpHandle : THandle;


dnsbuf : array[1..64] of char;


FAddr : sockaddr_in;


FArpTO : LongInt;


FBytesSent : integer;


FConnected : boolean;


FConnTO : LongInt;


FCustomMessage : TSSWndMethod;


FDescription : string;


FHandle : HWND;


FLookupNameDone : TNotifyEvent;


FMaxSockets : integer;


FOnAccept : TNotifyEvent;


FOnConnected : TNotifyEvent;


FOnDisconnected : TNotifyEvent;


FOnReadReady : TNotifyEvent;


FOnWriteReady : TNotifyEvent;


FSocket : TSock;


FSystemStatus : string;


FTimeoutEvt : TNotifyEvent;


FTransTO : LongInt;


FWinsockInitialized : Boolean;


FWinsockLoaded : Boolean;


HostEntryBuf : array[1..MAXGETHOSTSTRUCT] of byte;


MyWsaData : WsaData;


sa : in_addr;


Timer : LongInt;


TimerID : LongInt;


WinsockLib : THandle;



Constructors


constructor Create(AOwner: TComponent);


Functions


procedure Accept(ListeningSocket: Tmsocket);


procedure Connect;


procedure CreateICMPSocket;


procedure CreateTCPSocket;


destructor Destroy;


procedure Disconnect;


procedure FillAddress(address: string);


procedure FillName;


procedure FillPort(port: word);


function GetAddressString: string;


function GetLocalAddress: string;


function GetLocalHost: string;


function GetLocalPort: u_short;


function InitializeWinsock: Boolean;


procedure Listen;


function LoadWinsock(wsPath: string): Boolean;


procedure LookupName(host: string);


function RecvBuf(buf: PChar; cnt: integer): integer;


function SendBuf(buf: PChar; cnt: integer): integer;


function SendBufOOB(buf: PChar; cnt: integer): integer;


procedure SetServer(s: string);


procedure SetTimeout(seconds: LongInt);

end session bug


procedure ShutdownWinsock;


procedure UnloadWinsock;


procedure AcceptReady;


procedure Connected;


procedure Disconnected;


procedure LookupNameDone;


procedure ReadReady;


procedure WriteReady;


procedure SockWndProc(var Message: TMessage);


Properties


property Port : u_short


property Server : string


property CustomMessage : TSSWndMethod


property Description : string


property Handle : HWND


property IsConnected : Boolean


property MaxSockets : integer


property Socket : TSock


property SystemStatus : string


property TimeOutArp : LongInt


property TimeOutConnect : LongInt


property TimeOutTransaction : LongInt


property Version : string


property WinsockInitialized : Boolean


property WinsockLoaded : Boolean


Events


event OnAccept : TNotifyEvent


event OnConnected : TNotifyEvent


event OnDisconnected : TNotifyEvent


event OnLookupNameDone : TNotifyEvent


event OnReadReady : TNotifyEvent


event OnTimeOut : TNotifyEvent


event OnWriteReady : TNotifyEvent


Variables


Address : string;


FPort : u_short;


FServer : string;


Host : string;


LastError : word;


FVersion : string;


ArpHandle : THandle;


dnsbuf : array[1..64] of char;


FAddr : sockaddr_in;


FArpTO : LongInt;


FBytesSent : integer;


FConnected : boolean;


FConnTO : LongInt;


FCustomMessage : TSSWndMethod;


FDescription : string;


FHandle : HWND;


FLookupNameDone : TNotifyEvent;


FMaxSockets : integer;


FOnAccept : TNotifyEvent;


FOnConnected : TNotifyEvent;


FOnDisconnected : TNotifyEvent;


FOnReadReady : TNotifyEvent;


FOnWriteReady : TNotifyEvent;


FSocket : TSock;


FSystemStatus : string;


FTimeoutEvt : TNotifyEvent;


FTransTO : LongInt;


FWinsockInitialized : Boolean;


FWinsockLoaded : Boolean;


HostEntryBuf : array[1..MAXGETHOSTSTRUCT] of byte;


MyWsaData : WsaData;


sa : in_addr;


Timer : LongInt;


TimerID : LongInt;


WinsockLib : THandle;