Classe TBlockSocket
Unit
Declaração
type TBlockSocket = class(TObject)
Descrição
Basic IP object.
This is parent class for other class with protocol implementations. Do not use this class directly! Use TICMPBlockSocket, TRAWBlockSocket, TTCPBlockSocket or TUDPBlockSocket instead.
Hierarquia
- TObject
- TBlockSocket
Visão Geral
Campos
![]() |
FSocket: TSocket; |
![]() |
FLastError: Integer; |
![]() |
FLastErrorDesc: string; |
![]() |
FOwner: TObject; |
Métodos
![]() |
procedure SetDelayedOption(const Value: TSynaOption); |
![]() |
procedure DelayedOption(const Value: TSynaOption); |
![]() |
procedure ProcessDelayedOptions; |
![]() |
procedure InternalCreateSocket(Sin: TVarSin); |
![]() |
procedure SetSin(var Sin: TVarSin; IP, Port: string); |
![]() |
function GetSinIP(Sin: TVarSin): string; |
![]() |
function GetSinPort(Sin: TVarSin): Integer; |
![]() |
procedure DoStatus(Reason: THookSocketReason; const Value: string); |
![]() |
procedure DoReadFilter(Buffer: TMemory; var Len: Integer); |
![]() |
procedure DoMonitor(Writing: Boolean; const Buffer: TMemory; Len: Integer); |
![]() |
procedure DoCreateSocket; |
![]() |
procedure DoHeartbeat; |
![]() |
procedure LimitBandwidth(Length: Integer; MaxB: integer; var Next: LongWord); |
![]() |
procedure SetBandwidth(Value: Integer); |
![]() |
function TestStopFlag: Boolean; |
![]() |
procedure InternalSendStream(const Stream: TStream; WithSize, Indy: boolean); virtual; |
![]() |
function InternalCanRead(Timeout: Integer): Boolean; virtual; |
![]() |
function InternalCanWrite(Timeout: Integer): Boolean; virtual; |
![]() |
constructor Create; |
![]() |
constructor CreateAlternate(Stub: string); |
![]() |
destructor Destroy; override; |
![]() |
procedure CreateSocket; |
![]() |
procedure CreateSocketByName(const Value: String); |
![]() |
procedure CloseSocket; virtual; |
![]() |
procedure AbortSocket; virtual; |
![]() |
procedure Bind(const IP, Port: string); |
![]() |
procedure Connect(IP, Port: string); virtual; |
![]() |
procedure Listen; virtual; |
![]() |
function Accept: TSocket; virtual; |
![]() |
function SendBuffer(const Buffer: Tmemory; Length: Integer): Integer; virtual; |
![]() |
procedure SendByte(Data: Byte); virtual; |
![]() |
procedure SendString(Data: AnsiString); virtual; |
![]() |
procedure SendInteger(Data: integer); virtual; |
![]() |
procedure SendBlock(const Data: AnsiString); virtual; |
![]() |
procedure SendStreamRaw(const Stream: TStream); virtual; |
![]() |
procedure SendStream(const Stream: TStream); virtual; |
![]() |
procedure SendStreamIndy(const Stream: TStream); virtual; |
![]() |
function RecvBuffer(Buffer: TMemory; Length: Integer): Integer; virtual; |
![]() |
function RecvBufferEx(Buffer: Tmemory; Len: Integer; Timeout: Integer): Integer; virtual; |
![]() |
function RecvBufferStr(Len: Integer; Timeout: Integer): AnsiString; virtual; |
![]() |
function RecvByte(Timeout: Integer): Byte; virtual; |
![]() |
function RecvInteger(Timeout: Integer): Integer; virtual; |
![]() |
function RecvString(Timeout: Integer): AnsiString; virtual; |
![]() |
function RecvTerminated(Timeout: Integer; const Terminator: AnsiString): AnsiString; virtual; |
![]() |
function RecvPacket(Timeout: Integer): AnsiString; virtual; |
![]() |
function RecvBlock(Timeout: Integer): AnsiString; virtual; |
![]() |
procedure RecvStreamRaw(const Stream: TStream; Timeout: Integer); virtual; |
![]() |
procedure RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: int64); |
![]() |
procedure RecvStream(const Stream: TStream; Timeout: Integer); virtual; |
![]() |
procedure RecvStreamIndy(const Stream: TStream; Timeout: Integer); virtual; |
![]() |
function PeekBuffer(Buffer: TMemory; Length: Integer): Integer; virtual; |
![]() |
function PeekByte(Timeout: Integer): Byte; virtual; |
![]() |
function WaitingData: Integer; virtual; |
![]() |
function WaitingDataEx: Integer; |
![]() |
procedure Purge; |
![]() |
procedure SetLinger(Enable: Boolean; Linger: Integer); |
![]() |
procedure GetSinLocal; |
![]() |
procedure GetSinRemote; |
![]() |
procedure GetSins; |
![]() |
procedure ResetLastError; |
![]() |
function SockCheck(SockResult: Integer): Integer; virtual; |
![]() |
procedure ExceptCheck; |
![]() |
function LocalName: string; |
![]() |
procedure ResolveNameToIP(Name: string; const IPList: TStrings); |
![]() |
function ResolveName(Name: string): string; |
![]() |
function ResolveIPToName(IP: string): string; |
![]() |
function ResolvePort(Port: string): Word; |
![]() |
procedure SetRemoteSin(IP, Port: string); |
![]() |
function GetLocalSinIP: string; virtual; |
![]() |
function GetRemoteSinIP: string; virtual; |
![]() |
function GetLocalSinPort: Integer; virtual; |
![]() |
function GetRemoteSinPort: Integer; virtual; |
![]() |
function CanRead(Timeout: Integer): Boolean; virtual; |
![]() |
function CanReadEx(Timeout: Integer): Boolean; virtual; |
![]() |
function CanWrite(Timeout: Integer): Boolean; virtual; |
![]() |
function SendBufferTo(const Buffer: TMemory; Length: Integer): Integer; virtual; |
![]() |
function RecvBufferFrom(Buffer: TMemory; Length: Integer): Integer; virtual; |
![]() |
function GroupCanRead(const SocketList: TSocketList; Timeout: Integer; const CanReadList: TSocketList): Boolean; |
![]() |
procedure EnableReuse(Value: Boolean); |
![]() |
procedure SetTimeout(Timeout: Integer); |
![]() |
procedure SetSendTimeout(Timeout: Integer); |
![]() |
procedure SetRecvTimeout(Timeout: Integer); |
![]() |
function GetSocketType: integer; Virtual; |
![]() |
function GetSocketProtocol: integer; Virtual; |
![]() |
class function GetErrorDesc(ErrorCode: Integer): string; |
![]() |
function GetErrorDescEx: string; virtual; |
Propriedades
![]() |
property WSAData: TWSADATA read GetWsaData; |
![]() |
property FDset: TFDSet read FFDset; |
![]() |
property LocalSin: TVarSin read FLocalSin write FLocalSin; |
![]() |
property RemoteSin: TVarSin read FRemoteSin write FRemoteSin; |
![]() |
property Socket: TSocket read FSocket write SetSocket; |
![]() |
property LastError: Integer read FLastError; |
![]() |
property LastErrorDesc: string read FLastErrorDesc; |
![]() |
property LineBuffer: AnsiString read FBuffer write FBuffer; |
![]() |
property SizeRecvBuffer: Integer read GetSizeRecvBuffer write SetSizeRecvBuffer; |
![]() |
property SizeSendBuffer: Integer read GetSizeSendBuffer write SetSizeSendBuffer; |
![]() |
property NonBlockMode: Boolean read FNonBlockMode Write SetNonBlockMode; |
![]() |
property TTL: Integer read GetTTL Write SetTTL; |
![]() |
property IP6used: Boolean read FIP6used; |
![]() |
property RecvCounter: int64 read FRecvCounter; |
![]() |
property SendCounter: int64 read FSendCounter; |
![]() |
property Tag: Integer read FTag write FTag; |
![]() |
property RaiseExcept: Boolean read FRaiseExcept write FRaiseExcept; |
![]() |
property MaxLineLength: Integer read FMaxLineLength Write FMaxLineLength; |
![]() |
property MaxSendBandwidth: Integer read FMaxSendBandwidth Write FMaxSendBandwidth; |
![]() |
property MaxRecvBandwidth: Integer read FMaxRecvBandwidth Write FMaxRecvBandwidth; |
![]() |
property MaxBandwidth: Integer Write SetBandwidth; |
![]() |
property ConvertLineEnd: Boolean read FConvertLineEnd Write FConvertLineEnd; |
![]() |
property Family: TSocketFamily read FFamily Write SetFamily; |
![]() |
property PreferIP4: Boolean read FPreferIP4 Write FPreferIP4; |
![]() |
property InterPacketTimeout: Boolean read FInterPacketTimeout Write FInterPacketTimeout; |
![]() |
property SendMaxChunk: Integer read FSendMaxChunk Write FSendMaxChunk; |
![]() |
property StopFlag: Boolean read FStopFlag Write FStopFlag; |
![]() |
property NonblockSendTimeout: Integer read FNonblockSendTimeout Write FNonblockSendTimeout; |
![]() |
property ConnectionTimeout: Integer read FConnectionTimeout write FConnectionTimeout; |
![]() |
property OnStatus: THookSocketStatus read FOnStatus write FOnStatus; |
![]() |
property OnReadFilter: THookDataFilter read FOnReadFilter write FOnReadFilter; |
![]() |
property OnCreateSocket: THookCreateSocket read FOnCreateSocket write FOnCreateSocket; |
![]() |
property OnMonitor: THookMonitor read FOnMonitor write FOnMonitor; |
![]() |
property OnHeartbeat: THookHeartbeat read FOnHeartbeat write FOnHeartbeat; |
![]() |
property HeartbeatRate: integer read FHeartbeatRate Write FHeartbeatRate; |
![]() |
property Owner: TObject read FOwner Write FOwner; |
Descrição
Campos
![]() |
FSocket: TSocket; |
![]() |
FLastError: Integer; |
![]() |
FLastErrorDesc: string; |
![]() |
FOwner: TObject; |
Métodos
![]() |
procedure SetDelayedOption(const Value: TSynaOption); |
![]() |
procedure DelayedOption(const Value: TSynaOption); |
![]() |
procedure ProcessDelayedOptions; |
![]() |
procedure InternalCreateSocket(Sin: TVarSin); |
![]() |
procedure SetSin(var Sin: TVarSin; IP, Port: string); |
![]() |
function GetSinIP(Sin: TVarSin): string; |
![]() |
function GetSinPort(Sin: TVarSin): Integer; |
![]() |
procedure DoStatus(Reason: THookSocketReason; const Value: string); |
![]() |
procedure DoReadFilter(Buffer: TMemory; var Len: Integer); |
![]() |
procedure DoMonitor(Writing: Boolean; const Buffer: TMemory; Len: Integer); |
![]() |
procedure DoCreateSocket; |
![]() |
procedure DoHeartbeat; |
![]() |
procedure LimitBandwidth(Length: Integer; MaxB: integer; var Next: LongWord); |
![]() |
procedure SetBandwidth(Value: Integer); |
![]() |
function TestStopFlag: Boolean; |
![]() |
procedure InternalSendStream(const Stream: TStream; WithSize, Indy: boolean); virtual; |
![]() |
function InternalCanRead(Timeout: Integer): Boolean; virtual; |
![]() |
function InternalCanWrite(Timeout: Integer): Boolean; virtual; |
![]() |
constructor Create; |
![]() |
constructor CreateAlternate(Stub: string); |
Create object and load all necessary socket library. What library is loaded is described by STUB parameter. If STUB is empty string, then is loaded default libraries. |
![]() |
destructor Destroy; override; |
![]() |
procedure CreateSocket; |
If family is not SF_Any, then create socket with type defined in Family property. If family is SF_Any, then do nothing! (socket is created automaticly when you know what type of socket you need to create. (i.e. inside Connect or Bind call.) When socket is created, then is aplyed all stored delayed socket options. |
![]() |
procedure CreateSocketByName(const Value: String); |
It create socket. Address resolving of Value tells what type of socket is created. If Value is resolved as IPv4 IP, then is created IPv4 socket. If value is resolved as IPv6 address, then is created IPv6 socket. |
![]() |
procedure CloseSocket; virtual; |
Destroy socket in use. This method is also automatically called from object destructor. |
![]() |
procedure AbortSocket; virtual; |
![]() |
procedure Bind(const IP, Port: string); |
Connects socket to local IP address and PORT. IP address may be numeric or symbolic ('192.168.74.50', 'cosi.nekde.cz', 'ff08::1'). The same for PORT
If port value is '0', system chooses itself and conects unused port in the range 1024 to 4096 (this depending by operating system!). Structure LocalSin is filled after calling this method. Note: If you call this on non-created socket, then socket is created automaticly. Warning: when you call : |
![]() |
procedure Connect(IP, Port: string); virtual; |
Connects socket to remote IP address and PORT. The same rules as with BIND method are valid. The only exception is that PORT with 0 value will not be connected! Structures LocalSin and RemoteSin will be filled with valid values. When you call this on non-created socket, then socket is created automaticly. Type of created socket is by Family property. If is used SF_IP4, then is created socket for IPv4. If is used SF_IP6, then is created socket for IPv6. When you have family on SF_Any (default!), then type of created socket is determined by address resolving of destination address. (Not work properly on prilimitary winsock IPv6 support!) |
![]() |
procedure Listen; virtual; |
Sets socket to receive mode for new incoming connections. It is necessary to use TBlockSocket.BIND function call before this method to select receiving port! |
![]() |
function Accept: TSocket; virtual; |
Waits until new incoming connection comes. After it comes a new socket is automatically created (socket handler is returned by this function as result). |
![]() |
function SendBuffer(const Buffer: Tmemory; Length: Integer): Integer; virtual; |
Sends data of LENGTH from BUFFER address via connected socket. System automatically splits data to packets. |
![]() |
procedure SendByte(Data: Byte); virtual; |
One data BYTE is sent via connected socket. |
![]() |
procedure SendString(Data: AnsiString); virtual; |
Send data string via connected socket. Any terminator is not added! If you need send true string with CR-LF termination, you must add CR-LF characters to sended string! Because any termination is not added automaticly, you can use this function for sending any binary data in binary string. |
![]() |
procedure SendInteger(Data: integer); virtual; |
Send integer as four bytes to socket. |
![]() |
procedure SendBlock(const Data: AnsiString); virtual; |
Send data as one block to socket. Each block begin with 4 bytes with length of data in block. This 4 bytes is added automaticly by this function. |
![]() |
procedure SendStreamRaw(const Stream: TStream); virtual; |
Send data from stream to socket. |
![]() |
procedure SendStream(const Stream: TStream); virtual; |
![]() |
procedure SendStreamIndy(const Stream: TStream); virtual; |
Send content of stream to socket. It using SendBlock method and this is compatible with streams in Indy library. |
![]() |
function RecvBuffer(Buffer: TMemory; Length: Integer): Integer; virtual; |
Note: This is low-level receive function. You must be sure if data is waiting for read before call this function for avoid deadlock! Waits until allocated buffer is filled by received data. Returns number of data received, which equals to LENGTH value under normal operation. If it is not equal the communication channel is possibly broken. On stream oriented sockets if is received 0 bytes, it mean 'socket is closed!" On datagram socket is readed first waiting datagram. |
![]() |
function RecvBufferEx(Buffer: Tmemory; Len: Integer; Timeout: Integer): Integer; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions! Method waits until data is received. If no data is received within TIMEOUT (in milliseconds) period, LastError is set to WSAETIMEDOUT. Methods serves for reading any size of data (i.e. one megabyte...). This method is preffered for reading from stream sockets (like TCP). |
![]() |
function RecvBufferStr(Len: Integer; Timeout: Integer): AnsiString; virtual; |
Similar to RecvBufferEx, but readed data is stored in binary string, not in memory buffer. |
![]() |
function RecvByte(Timeout: Integer): Byte; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions. Waits until one data byte is received which is also returned as function result. If no data is received within TIMEOUT (in milliseconds)period, LastError is set to WSAETIMEDOUT and result have value 0. |
![]() |
function RecvInteger(Timeout: Integer): Integer; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions. Waits until one four bytes are received and return it as one Ineger Value. If no data is received within TIMEOUT (in milliseconds)period, LastError is set to WSAETIMEDOUT and result have value 0. |
![]() |
function RecvString(Timeout: Integer): AnsiString; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions. Method waits until data string is received. This string is terminated by CR-LF characters. The resulting string is returned without this termination (CR-LF)! If ConvertLineEnd is used, then CR-LF sequence may not be exactly CR-LF. See ConvertLineEnd description. If no data is received within TIMEOUT (in milliseconds) period, LastError is set to WSAETIMEDOUT. You may also specify maximum length of reading data by MaxLineLength property. |
![]() |
function RecvTerminated(Timeout: Integer; const Terminator: AnsiString): AnsiString; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions. Method waits until data string is received. This string is terminated by Terminator string. The resulting string is returned without this termination. If no data is received within TIMEOUT (in milliseconds) period, LastError is set to WSAETIMEDOUT. You may also specify maximum length of reading data by MaxLineLength property. |
![]() |
function RecvPacket(Timeout: Integer): AnsiString; virtual; |
Note: This is high-level receive function. It using internal LineBuffer and you can combine this function freely with other high-level functions. Method reads all data waiting for read. If no data is received within TIMEOUT (in milliseconds) period, LastError is set to WSAETIMEDOUT. Methods serves for reading unknown size of data. Because before call this function you don't know size of received data, returned data is stored in dynamic size binary string. This method is preffered for reading from stream sockets (like TCP). It is very goot for receiving datagrams too! (UDP protocol) |
![]() |
function RecvBlock(Timeout: Integer): AnsiString; virtual; |
Read one block of data from socket. Each block begin with 4 bytes with length of data in block. This function read first 4 bytes for get lenght, then it wait for reported count of bytes. |
![]() |
procedure RecvStreamRaw(const Stream: TStream; Timeout: Integer); virtual; |
Read all data from socket to stream until socket is closed (or any error occured.) |
![]() |
procedure RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: int64); |
Read requested count of bytes from socket to stream. |
![]() |
procedure RecvStream(const Stream: TStream; Timeout: Integer); virtual; |
Receive data to stream. It using RecvBlock method. |
![]() |
procedure RecvStreamIndy(const Stream: TStream; Timeout: Integer); virtual; |
Receive data to stream. This function is compatible with similar function in Indy library. It using RecvBlock method. |
![]() |
function PeekBuffer(Buffer: TMemory; Length: Integer): Integer; virtual; |
Same as RecvBuffer, but readed data stays in system input buffer. Warning: this function not respect data in LineBuffer! Is not recommended to use this function! |
![]() |
function PeekByte(Timeout: Integer): Byte; virtual; |
Same as RecvByte, but readed data stays in input system buffer. Warning: this function not respect data in LineBuffer! Is not recommended to use this function! |
![]() |
function WaitingData: Integer; virtual; |
On stream sockets it returns number of received bytes waiting for picking. 0 is returned when there is no such data. On datagram socket it returns length of the first waiting datagram. Returns 0 if no datagram is waiting. |
![]() |
function WaitingDataEx: Integer; |
Same as WaitingData, but if exists some of data in Linebuffer, return their length instead. |
![]() |
procedure Purge; |
Clear all waiting data for read from buffers. |
![]() |
procedure SetLinger(Enable: Boolean; Linger: Integer); |
Sets linger. Enabled linger means that the system waits another LINGER (in milliseconds) time for delivery of sent data. This function is only for stream type of socket! (TCP) |
![]() |
procedure GetSinLocal; |
Actualize values in LocalSin. |
![]() |
procedure GetSinRemote; |
Actualize values in RemoteSin. |
![]() |
procedure GetSins; |
![]() |
procedure ResetLastError; |
Reset LastError and LastErrorDesc to non-error state. |
![]() |
function SockCheck(SockResult: Integer): Integer; virtual; |
If you "manually" call Socket API functions, forward their return code as parameter to this function, which evaluates it, eventually calls GetLastError and found error code returns and stores to LastError. |
![]() |
procedure ExceptCheck; |
If LastError contains some error code and RaiseExcept property is |
![]() |
procedure ResolveNameToIP(Name: string; const IPList: TStrings); |
Try resolve name to all possible IP address. i.e. If you pass as name result of LocalName method, you get all IP addresses used by local system. |
![]() |
function ResolveName(Name: string): string; |
Try resolve name to primary IP address. i.e. If you pass as name result of LocalName method, you get primary IP addresses used by local system. |
![]() |
function ResolveIPToName(IP: string): string; |
Try resolve IP to their primary domain name. If IP not have domain name, then is returned original IP. |
![]() |
function ResolvePort(Port: string): Word; |
Try resolve symbolic port name to port number. (i.e. 'Echo' to 8) |
![]() |
procedure SetRemoteSin(IP, Port: string); |
Set information about remote side socket. It is good for seting remote side for sending UDP packet, etc. |
![]() |
function GetLocalSinIP: string; virtual; |
![]() |
function GetRemoteSinIP: string; virtual; |
![]() |
function GetLocalSinPort: Integer; virtual; |
![]() |
function GetRemoteSinPort: Integer; virtual; |
![]() |
function CanRead(Timeout: Integer): Boolean; virtual; |
Return This function is need only on special cases, when you need use RecvBuffer function directly! read functioms what have timeout as calling parameter, calling this function internally. |
![]() |
function CanReadEx(Timeout: Integer): Boolean; virtual; |
Same as CanRead, but additionally return |
![]() |
function CanWrite(Timeout: Integer): Boolean; virtual; |
Return This function is need only on special cases! |
![]() |
function SendBufferTo(const Buffer: TMemory; Length: Integer): Integer; virtual; |
Same as SendBuffer, but send datagram to address from RemoteSin. Usefull for sending reply to datagram received by function RecvBufferFrom. |
![]() |
function RecvBufferFrom(Buffer: TMemory; Length: Integer): Integer; virtual; |
Note: This is low-lever receive function. You must be sure if data is waiting for read before call this function for avoid deadlock! Receives first waiting datagram to allocated buffer. If there is no waiting one, then waits until one comes. Returns length of datagram stored in BUFFER. If length exceeds buffer datagram is truncated. After this RemoteSin structure contains information about sender of UDP packet. |
![]() |
function GroupCanRead(const SocketList: TSocketList; Timeout: Integer; const CanReadList: TSocketList): Boolean; |
This function is for check for incoming data on set of sockets. Whitch sockets is checked is decribed by SocketList Tlist with TBlockSocket objects. TList may have maximal number of objects defined by FD_SETSIZE constant. Return |
![]() |
procedure EnableReuse(Value: Boolean); |
By this method you may turn address reuse mode for local bind. It is good specially for UDP protocol. Using this with TCP protocol is hazardous! |
![]() |
procedure SetTimeout(Timeout: Integer); |
Try set timeout for all sending and receiving operations, if socket provider can do it. (It not supported by all socket providers!) |
![]() |
procedure SetSendTimeout(Timeout: Integer); |
Try set timeout for all sending operations, if socket provider can do it. (It not supported by all socket providers!) |
![]() |
procedure SetRecvTimeout(Timeout: Integer); |
Try set timeout for all receiving operations, if socket provider can do it. (It not supported by all socket providers!) |
![]() |
function GetSocketType: integer; Virtual; |
Return value of socket type. |
![]() |
function GetSocketProtocol: integer; Virtual; |
Return value of protocol type for socket creation. |
![]() |
class function GetErrorDesc(ErrorCode: Integer): string; |
Return descriptive string for given error code. This is class function. You may call it without created object! |
![]() |
function GetErrorDescEx: string; virtual; |
Return descriptive string for LastError. |
Propriedades
![]() |
property WSAData: TWSADATA read GetWsaData; |
WSA structure with information about socket provider. On non-windows platforms this structure is simulated! |
![]() |
property FDset: TFDSet read FFDset; |
|
![]() |
property LocalSin: TVarSin read FLocalSin write FLocalSin; |
Structure describing local socket side. |
![]() |
property RemoteSin: TVarSin read FRemoteSin write FRemoteSin; |
Structure describing remote socket side. |
![]() |
property Socket: TSocket read FSocket write SetSocket; |
|
![]() |
property LastError: Integer read FLastError; |
Last socket operation error code. Error codes are described in socket documentation. Human readable error description is stored in LastErrorDesc property. |
![]() |
property LastErrorDesc: string read FLastErrorDesc; |
![]() |
property LineBuffer: AnsiString read FBuffer write FBuffer; |
Buffer used by all high-level receiving functions. This buffer is used for optimized reading of data from socket. In normal cases you not need access to this buffer directly! |
![]() |
property SizeRecvBuffer: Integer read GetSizeRecvBuffer write SetSizeRecvBuffer; |
Size of Winsock receive buffer. If it is not supported by socket provider, it return as size one kilobyte. |
![]() |
property SizeSendBuffer: Integer read GetSizeSendBuffer write SetSizeSendBuffer; |
Size of Winsock send buffer. If it is not supported by socket provider, it return as size one kilobyte. |
![]() |
property TTL: Integer read GetTTL Write SetTTL; |
Set Time-to-live value. (if system supporting it!) |
![]() |
property IP6used: Boolean read FIP6used; |
If is |
![]() |
property RecvCounter: int64 read FRecvCounter; |
Return count of received bytes on this socket from begin of current connection. |
![]() |
property SendCounter: int64 read FSendCounter; |
Return count of sended bytes on this socket from begin of current connection. |
![]() |
property Tag: Integer read FTag write FTag; |
this value is for free use. |
![]() |
property RaiseExcept: Boolean read FRaiseExcept write FRaiseExcept; |
If |
![]() |
property MaxLineLength: Integer read FMaxLineLength Write FMaxLineLength; |
Define maximum length in bytes of LineBuffer for high-level receiving functions. If this functions try to read more data then this limit, error is returned! If value is 0 (default), no limitation is used. This is very good protection for stupid attacks to your server by sending lot of data without proper terminator... until all your memory is allocated by LineBuffer! Note: This maximum length is checked only in functions, what read unknown number of bytes! (like RecvString or RecvTerminated) |
![]() |
property MaxBandwidth: Integer Write SetBandwidth; |
Define maximal bandwidth for all sending and receiving operations in bytes per second. If value is 0 (default), bandwidth limitation is not used. |
![]() |
property ConvertLineEnd: Boolean read FConvertLineEnd Write FConvertLineEnd; |
Do a conversion of non-standard line terminators to CRLF. (Off by default) If |
![]() |
property Family: TSocketFamily read FFamily Write SetFamily; |
Specified |
![]() |
property PreferIP4: Boolean read FPreferIP4 Write FPreferIP4; |
When resolving of domain name return both IPv4 and IPv6 addresses, then specify if is used IPv4 (dafault - |
![]() |
property SendMaxChunk: Integer read FSendMaxChunk Write FSendMaxChunk; |
All sended datas was splitted by this value. |
![]() |
property StopFlag: Boolean read FStopFlag Write FStopFlag; |
By setting this property to |
![]() |
property NonblockSendTimeout: Integer read FNonblockSendTimeout Write FNonblockSendTimeout; |
Timeout for data sending by non-blocking socket mode. |
![]() |
property ConnectionTimeout: Integer read FConnectionTimeout write FConnectionTimeout; |
Timeout for Connect call. Default value 0 means default system timeout. Non-zero value means timeout in millisecond. |
![]() |
property OnStatus: THookSocketStatus read FOnStatus write FOnStatus; |
This event is called by various reasons. It is good for monitoring socket, create gauges for data transfers, etc. |
![]() |
property OnReadFilter: THookDataFilter read FOnReadFilter write FOnReadFilter; |
this event is good for some internal thinks about filtering readed datas. It is used by telnet client by example. |
![]() |
property OnCreateSocket: THookCreateSocket read FOnCreateSocket write FOnCreateSocket; |
This event is called after real socket creation for setting special socket options, because you not know when socket is created. (it is depended on Ipv4, IPv6 or automatic mode) |
![]() |
property OnMonitor: THookMonitor read FOnMonitor write FOnMonitor; |
This event is good for monitoring content of readed or writed datas. |
![]() |
property OnHeartbeat: THookHeartbeat read FOnHeartbeat write FOnHeartbeat; |
This event is good for calling your code during long socket operations. (Example, for refresing UI if class in not called within the thread.) Rate of heartbeats can be modified by HeartbeatRate property. |
![]() |
property HeartbeatRate: integer read FHeartbeatRate Write FHeartbeatRate; |
Specify typical rate of OnHeartbeat event and StopFlag testing. Default value 0 disabling heartbeats! Value is in milliseconds. Real rate can be higher or smaller then this value, because it depending on real socket operations too! Note: Each heartbeat slowing socket processing. |
![]() |
property Owner: TObject read FOwner Write FOwner; |
What class own this socket? Used by protocol implementation classes. |
Gerado por PasDoc 0.16.0.