Home Units Hierarchy Routines All identifiers

Class unaSTUNserver

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaSTUNserver = class(unaSTUNagent)

Description

STUN server

Hierarchy

Overview

Methods

Protected function doYourJob(addr: PSockAddrIn; buf: pointer; dataLen: int): bool; override;
Protected function readData(buf: pointer; maxSize: int; out addr: sockaddr_in): int; override;
Protected procedure doOnResponse(addr: PSockAddrIn; req: punaSTUN_hdr);
Protected procedure sendResponse(addr: PSockAddrIn; r: punaSTUN_hdr; _class, attr, datai: uint; const datas: wString; msg: int = C_STUN_MSGTYPE_BINDING); overload;
Protected procedure sendResponse(addr: PSockAddrIn; r: punaSTUN_hdr; _class: int; attrs: pointer; attrsLen: int; msg: int = C_STUN_MSGTYPE_BINDING); overload;
Protected procedure startIn(); override;

Properties

Public property numRequests: int64 read f_numReq;
Public property onResponse: unaSTUNServerOnResponse read f_onResponse write f_onResponse;

Description

Methods

Protected function doYourJob(addr: PSockAddrIn; buf: pointer; dataLen: int): bool; override;

Process clients' requests

Protected function readData(buf: pointer; maxSize: int; out addr: sockaddr_in): int; override;

Reads data from server TCP socket

Protected procedure doOnResponse(addr: PSockAddrIn; req: punaSTUN_hdr);

Notifies of response

Protected procedure sendResponse(addr: PSockAddrIn; r: punaSTUN_hdr; _class, attr, datai: uint; const datas: wString; msg: int = C_STUN_MSGTYPE_BINDING); overload;

Sends response to client

Parameters
addr
For UDP only: source address
r
original request
_class
Response class
attr
Attribute to add
datai
Integer data for attribute. Meanign depends on attribute
datas
String data for attribute. Meanign depends on attribute
Protected procedure sendResponse(addr: PSockAddrIn; r: punaSTUN_hdr; _class: int; attrs: pointer; attrsLen: int; msg: int = C_STUN_MSGTYPE_BINDING); overload;

Sends response to client

Parameters
addr
For UDP only: source address
r
original request
_class
Response class
attrs
Attributes to add
attrsLen
Size of all attributes
Protected procedure startIn(); override;

Start listening

Properties

Public property numRequests: int64 read f_numReq;

Number of requsts handled by server

Public property onResponse: unaSTUNServerOnResponse read f_onResponse write f_onResponse;
 

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09