Description | Hierarchy | Fields | Methods | Properties |
type unaSTUNagent = class(unaThread)
STUN base agent
constructor create(proto: int = C_STUN_PROTO_UDP; port: string = ''; const bind2ip: string = '0.0.0.0'); |
|
destructor Destroy(); override; |
|
function open(): bool; |
|
function doYourJob(addr: PSockAddrIn; buf: pointer; dataLen: int): bool; virtual; abstract; |
|
function execute(threadID: unsigned): int; override; |
|
function readData(buf: pointer; maxSize: int; out addr: sockaddr_in): int; virtual; abstract; |
|
procedure close(); |
|
procedure doOpen(); virtual; |
|
procedure startIn(); override; |
property active: bool read f_active; |
|
property port: string read f_port; |
|
property proto: int read f_proto; |
|
property socketError: int read f_socketError; |
constructor create(proto: int = C_STUN_PROTO_UDP; port: string = ''; const bind2ip: string = '0.0.0.0'); |
|
destructor Destroy(); override; |
|
function open(): bool; |
|
Opens client or server. |
function doYourJob(addr: PSockAddrIn; buf: pointer; dataLen: int): bool; virtual; abstract; |
|
Processes any pending job.
Parameters
ReturnsTrue if some job was done, or False if there was nothing to do |
function execute(threadID: unsigned): int; override; |
|
function readData(buf: pointer; maxSize: int; out addr: sockaddr_in): int; virtual; abstract; |
|
Reads data from internal or exteranal socket(s) Client and server will do it differently.
Parameters
ReturnsSize of data actually read |
procedure close(); |
|
Closes client or server. |
procedure doOpen(); virtual; |
|
Prepare for open. |
procedure startIn(); override; |
|
Prepares socket |
property active: bool read f_active; |
|
True if server or client is active. |
property port: string read f_port; |
|
Local server port for STUN Server Remote server port for STUN Client |
property proto: int read f_proto; |
|
Internal socket proto |
property socketError: int read f_socketError; |
|
Fatal socket error or 0 if no error. |
(c) 2012 Lake of Soft