Difference between revisions of "TUDPBuffer"

From Ultibo.org
Jump to: navigation, search
(Created page with "Return to Unit UDP __TOC__ === Description === ---- ''To be documented'' === Class definitions === ---- <div class="toccolours mw-collapsible mw-collapsed"...")
 
(No difference)

Latest revision as of 01:35, 31 May 2018

Return to Unit UDP


Description


To be documented

Class definitions



TUDPBuffer = class(TSocketBuffer)

constructor Create(ASocket:TTransportSocket);  
destructor Destroy; override;  
private
FOffset:Word; Offset to RemoteAddress
FLength:Word; Length of RemoteAddress
 
FRead:Pointer; Pointer to Next Read from Buffer
FWrite:Pointer; Pointer to Next Write to Buffer
 
FCount:LongWord; Number of Datagrams in Buffer
 
FFirst:PUDPDatagram; Pointer to First Datagram
FLast:PUDPDatagram; Pointer to Last Datagram
 
function AddDatagram(ASize:Integer):Boolean;  
function RemoveDatagram:Boolean;  
procedure FlushDatagrams;  
protected
procedure SetSize(ASize:LongWord); override;  
public
function GetNext:Integer;  
function GetCount:LongWord;  
 
function ReadBuffer(var ABuffer; var ASize:Integer; ARemoteAddress:Pointer; ARemotePort:PWORD; AFlags:Integer):Boolean;  
function WriteBuffer(var ABuffer; ASize:Integer; ARemoteAddress:Pointer; ARemotePort:PWORD):Boolean;  


Function declarations



constructor TUDPBuffer.Create(ASocket:TTransportSocket);
Description: To be documented
Note None documented


destructor TUDPBuffer.Destroy;
Description: To be documented
Note None documented


function TUDPBuffer.AddDatagram(ASize:Integer):Boolean;
Description: Adds a new Datagram as the Last datagram in the Buffer
Note None documented


function TUDPBuffer.RemoveDatagram:Boolean;
Description: Removes the First datagram from the Buffer
Note None documented


procedure TUDPBuffer.FlushDatagrams;
Description: To be documented
Note None documented


procedure TUDPBuffer.SetSize(ASize:LongWord);
Description: Setting the Size clears any current Datagrams
Note None documented


function TUDPBuffer.GetNext:Integer;
Description: To be documented
Note None documented


function TUDPBuffer.GetCount:LongWord;
Description: To be documented
Note None documented


function TUDPBuffer.ReadBuffer(var ABuffer; var ASize:Integer; ARemoteAddress:Pointer; ARemotePort:PWORD; AFlags:Integer):Boolean;
Description: Stored Datagram contains the Data without the Headers
Note Passed Size contains size of Buffer and should return the size of Datagram

Flags is for MSG_PEEK and MSG_OOB when applicable


function TUDPBuffer.WriteBuffer(var ABuffer; ASize:Integer; ARemoteAddress:Pointer; ARemotePort:PWORD):Boolean;
Description: Supplied Buffer contains the Data without the Headers
Note Data that will not fit in the Buffer is simply discarded


Return to Unit Reference