TWinsock2TCPSocket

From Ultibo.org
Revision as of 04:53, 6 November 2025 by Ultibo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Return to Unit Winsock2


Description


To be documented

Class definitions



TWinsock2TCPSocket = class(TWinsock2Socket)

Note: Stream Socket (SOCK_STREAM) classes
 
public
constructor Create;  
private
FUseNagle:Boolean;  
FUseKeepalive:Boolean;  
FSegmentSize:Integer;  
 
procedure SetSocketType(ASocketType:Integer); override;  
procedure SetProtocol(AProtocol:Integer); override;  
 
procedure SetBacklog(ABacklog:Integer);  
 
procedure SetUseNagle(AUseNagle:Boolean);  
procedure SetUseKeepalive(AUseKeepalive:Boolean);  
procedure SetSegmentSize(ASegmentSize:Integer);  
function GetMaxSegmentSize:LongWord;  
procedure SetMaxSegmentSize(AMaxSegmentSize:LongWord);  
protected
FBacklog:Integer;  
FMaxSegmentSize:LongWord;  
 
function Listen(ABacklog:Integer):LongInt;  
 
function ReadFromSocket(AData:Pointer; ASize:Integer):LongInt; virtual;  
function WriteToSocket(AData:Pointer; ASize:Integer):LongInt; virtual;  
 
function ReadFromSocketEx(AData:Pointer; ASize:Integer; var ACount:Integer; var AClosed:Boolean; AWait:Boolean; ATimeout:Integer):LongInt; virtual;  
function WriteToSocketEx(AData:Pointer; ASize:Integer; var ACount:Integer; AWait:Boolean; ATimeout:Integer):LongInt; virtual;  
public
property Backlog:Integer read FBacklog write SetBacklog;  
 
property UseNagle:Boolean read FUseNagle write SetUseNagle;  
property UseKeepalive:Boolean read FUseKeepalive write SetUseKeepalive;  
property SegmentSize:Integer read FSegmentSize write SetSegmentSize;  
property MaxSegmentSize:LongWord read GetMaxSegmentSize write SetMaxSegmentSize;  
 
function ReadData(AData:Pointer; ACount:Integer):Boolean; virtual;  
function WriteData(AData:Pointer; ACount:Integer):Boolean; virtual;  
 
function ReadAvailable(AData:Pointer; ASize:Integer; var ACount:Integer; var AClosed:Boolean):Boolean; virtual;  


Function declarations



constructor TWinsock2TCPSocket.Create;
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetSocketType(ASocketType:Integer);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetProtocol(AProtocol:Integer);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetBacklog(ABacklog:Integer);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetUseNagle(AUseNagle:Boolean);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetUseKeepalive(AUseKeepalive:Boolean);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.SetSegmentSize(ASegmentSize:Integer);
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.GetMaxSegmentSize:LongWord;
Description: To be documented
Note None documented


procedure TWinsock2TCPSocket.MaxSegmentSize:LongWord read GetMaxSegmentSize write SetMaxSegmentSize;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.Listen(ABacklog:Integer):LongInt;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.ReadFromSocket(AData:Pointer; ASize:Integer):LongInt;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.WriteToSocket(AData:Pointer; ASize:Integer):LongInt;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.ReadFromSocketEx(AData:Pointer; ASize:Integer; var ACount:Integer; var AClosed:Boolean; AWait:Boolean; ATimeout:Integer):LongInt;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.WriteToSocketEx(AData:Pointer; ASize:Integer; var ACount:Integer; AWait:Boolean; ATimeout:Integer):LongInt;
Description: To be documented
Note None documented


function TWinsock2TCPSocket.ReadData(AData:Pointer; ACount:Integer):Boolean;
Description: Read data from the TCP stream socket associated with this object
Data A pointer to a buffer to receive the data
Count The number of bytes to read
Return True if the data was read successfully or False on error
Note This function will not return until Count bytes has been read or an error occurs


function TWinsock2TCPSocket.WriteData(AData:Pointer; ACount:Integer):Boolean;
Description: Write data to the TCP stream socket associated with this object
Data A pointer to a buffer containing the data to write
Count The number of bytes to be written
Return True if the data was written successfully or False on error
Note This function will not return until Count bytes has been written or an error occurs


function TWinsock2TCPSocket.ReadAvailable(AData:Pointer; ASize:Integer; var ACount:Integer; var AClosed:Boolean):Boolean;
Description: Read all available data from the TCP stream socket associated with this object
Data A pointer to a buffer to receive the data
Size The size in bytes of the buffer
Count On return the total number of bytes read, may be less than Size if socket has been Closed
Closed On return True if the socket has been closed
Return True if the data was read successfully or False on error
Note This function will not return until Size bytes has been read, the socket is Closed or an error occurs


Return to Unit Reference