Description | Hierarchy | Fields | Methods | Properties |
type unavclInOutIpPipe = class(unavclInOutPipe)
Base abstract class for TCP/IP stream pipes.
function getErrorCode(): int; |
|
function getHostAddr(connId: tConID = $FFFFFFFF): pSockAddrIn; |
|
function getHostInfo(out ip, port: string; connId: tConID = $FFFFFFFF): bool; overload; |
|
function sendData(connId: tConID; data: pointer; len: uint): tunaSendResult; |
|
function sendPacket(connId: tConID; cmd: uint; data: pointer = nil; len: uint = 0; timeout: tTimeout = 80): tunaSendResult; |
|
function sendText(connId: tConID; const data: aString): tunaSendResult; |
|
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override; |
|
function doOpen(): bool; override; |
|
function doRead(data: pointer; len: uint): uint; override; |
|
function doSendPacket(connId: tConID; cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 79): tunaSendResult; virtual; abstract; |
|
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
function getAvailableDataLen(index: integer): uint; override; |
|
function getFormatExchangeData(out data: pointer): uint; override; |
|
function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; virtual; |
|
function initSocksThread(): tConID; virtual; abstract; |
|
function isActive(): bool; override; |
|
function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; virtual; |
|
function onNewPacketData(dataType: int; data: pointer; len: uint): bool; virtual; |
|
function sendPacketToSocket(connId: tConID; seqNum, cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 78): tunaSendResult; |
|
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure doClose(); override; |
|
procedure doOnSocketEvent(sender: tObject; event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint); virtual; |
|
procedure onPacketsLost(connId: tConID; lostCount: int; worker: uint); virtual; |
|
procedure sendFormat(connId: tConID); |
|
procedure sendGoodbye(connId: tConID); virtual; abstract; |
property bindTo: string read f_bindToIP write f_bindToIP; |
|
property bindToPort: string read f_bindToPort write f_bindToPort; |
|
property bytesReceived: int64 read f_bytesReceived; |
|
property bytesSent: int64 read f_bytesSent; |
|
property host: string read f_host write f_host; |
|
property inPacketsCount: int64 read f_inPacketsCount; |
|
property inPacketsCrcErrors: unsigned read f_crcErrors; |
|
property inPacketsDupCount: unsigned read f_dupCount; |
|
property inPacketsOutOfSeq: unsigned read f_outOfSeq; |
|
property isFormatProvider; |
|
property localFormat: pointer read f_localFormat; |
|
property onDataAvailable; |
|
property onDataSent: tunavclUserDataEvent read f_onDataSent write f_onDataSent; |
|
property onFormatChangeAfter; |
|
property onFormatChangeBefore; |
|
property onPacketEvent: tunavclPacketEvent read f_onPacketEvent write f_onPacketEvent; |
|
property onSocketEvent: tunavclSocketEvent read f_onSocketEvent write f_onSocketEvent; |
|
property onTextData: tunavclTextDataEvent read f_onTextData write f_onTextData; |
|
property onUserData: tunavclUserDataEvent read f_onUserData write f_onUserData; |
|
property outPacketsCount: int64 read f_outPacketsCount; |
|
property port: string read f_port write f_port; |
|
property proto: tunavclProtoType read f_proto write f_proto default unapt_UDP; |
|
property remoteFormat: pointer read f_remoteFormat; |
|
property socks: unaSocks read f_socks; |
|
property socksId: tConID read f_socksId; |
|
property streamByteOrderInput: tunavclStreamByteOrder read f_inStreamByteOrder write f_inStreamByteOrder default unasbo_dontCare; |
|
property streamByteOrderOutput: tunavclStreamByteOrder read f_outStreamByteOrder write f_outStreamByteOrder default unasbo_dontCare; |
|
property streamingMode: tunavclStreamingMode read f_streamingMode write f_streamingMode default unasm_VC; |
function getErrorCode(): int; |
|
function getHostAddr(connId: tConID = $FFFFFFFF): pSockAddrIn; |
|
Returns client connection object. NOTE! Connection's release() method must be called when connection object is no longer needed. |
function getHostInfo(out ip, port: string; connId: tConID = $FFFFFFFF): bool; overload; |
|
function sendData(connId: tConID; data: pointer; len: uint): tunaSendResult; |
|
Sends user data into the IP stream. |
function sendPacket(connId: tConID; cmd: uint; data: pointer = nil; len: uint = 0; timeout: tTimeout = 80): tunaSendResult; |
|
Sends a packet into the IP stream. |
function sendText(connId: tConID; const data: aString): tunaSendResult; |
|
Sends a text into the IP stream. |
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override; |
|
Since IP components sends and receives format from remote side, we should not bother local consumers, as it is done in parent's applyFormat(), unless we had received a remote format |
function doOpen(): bool; override; |
|
Opens the TCP/IP stream. |
function doRead(data: pointer; len: uint): uint; override; |
|
You cannot read from a socket. Use onDataAvailable event or override the onNewData() method to be notified when new data arrives. ReturnsThis method always returns 0. |
function doSendPacket(connId: tConID; cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 79): tunaSendResult; virtual; abstract; |
|
Sends a packet to remote side. |
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
Should write data into the TCP/IP stream. |
function getAvailableDataLen(index: integer): uint; override; |
|
ReturnsThis method always returns 0. |
function getFormatExchangeData(out data: pointer): uint; override; |
|
function handleSocketEvent(event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint): bool; virtual; |
|
Handles socket event. |
function initSocksThread(): tConID; virtual; abstract; |
|
Initializes the TCP/IP stream socket. |
function isActive(): bool; override; |
|
Returns active state of the TCP/IP stream. |
function onNewPacket(cmd: uint; data: pointer; len: uint; connId: tConID; worker: uint): bool; virtual; |
|
function onNewPacketData(dataType: int; data: pointer; len: uint): bool; virtual; |
|
Triggers when new packet is available for the TCP/IP stream. |
function sendPacketToSocket(connId: tConID; seqNum, cmd: uint; out asynch: bool; data: pointer = nil; len: uint = 0; timeout: tTimeout = 78): tunaSendResult; |
|
// |
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure doClose(); override; |
|
Closes the TCP/IP stream. |
procedure doOnSocketEvent(sender: tObject; event: unaSocketEvent; id, connId: tConID; data: pointer; len: uint); virtual; |
|
Fired by underlying socket provider. See also handleSocketEvent(). |
procedure onPacketsLost(connId: tConID; lostCount: int; worker: uint); virtual; |
|
procedure sendFormat(connId: tConID); |
|
Sends local format (if specified) to remote side. |
procedure sendGoodbye(connId: tConID); virtual; abstract; |
|
Sends goodbye command to all underlying connections. |
property bindTo: string read f_bindToIP write f_bindToIP; |
|
Specifies IP address to bind to when socket is about to be open (either for listening or for connection). Default is '0.0.0.0' which means socket will bind to first available interface. |
property bindToPort: string read f_bindToPort write f_bindToPort; |
|
Specifies port name/number to bind to when socket is about to be open (either for listening or for connection). Default is '0' which means socket will bind to first available port. |
property bytesReceived: int64 read f_bytesReceived; |
|
property bytesSent: int64 read f_bytesSent; |
|
property host: string read f_host write f_host; |
|
Specifies host name (or IP address) for the client TCP/IP socket. |
property inPacketsCount: int64 read f_inPacketsCount; |
|
Returns number of packets received. |
property inPacketsCrcErrors: unsigned read f_crcErrors; |
|
property inPacketsDupCount: unsigned read f_dupCount; |
|
property inPacketsOutOfSeq: unsigned read f_outOfSeq; |
|
property isFormatProvider; |
|
property localFormat: pointer read f_localFormat; |
|
property onDataAvailable; |
|
property onDataSent: tunavclUserDataEvent read f_onDataSent write f_onDataSent; |
|
Triggers when new portion of data was sent to remote host. |
property onFormatChangeAfter; |
|
property onFormatChangeBefore; |
|
property onPacketEvent: tunavclPacketEvent read f_onPacketEvent write f_onPacketEvent; |
|
Triggers when new packet is available. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event. |
property onSocketEvent: tunavclSocketEvent read f_onSocketEvent write f_onSocketEvent; |
|
Triggers when socket event occurs. |
property onTextData: tunavclTextDataEvent read f_onTextData write f_onTextData; |
|
Triggers when text data is available. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event. |
property onUserData: tunavclUserDataEvent read f_onUserData write f_onUserData; |
|
Triggers when user data is available. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event. |
property outPacketsCount: int64 read f_outPacketsCount; |
|
Returns number of packets sent. |
property port: string read f_port write f_port; |
|
Specifies port number for the client/server TCP/IP socket. |
property proto: tunavclProtoType read f_proto write f_proto default unapt_UDP; |
|
Specifies Proto for the TCP/IP socket (TCP or UDP). |
property remoteFormat: pointer read f_remoteFormat; |
|
property socks: unaSocks read f_socks; |
|
property socksId: tConID read f_socksId; |
|
property streamByteOrderInput: tunavclStreamByteOrder read f_inStreamByteOrder write f_inStreamByteOrder default unasbo_dontCare; |
|
Specifies how to analyze the byte order and position in received data when doing PCM raw streaming. It could leave bytes as they are, always swap, or autodetect the order. Default is unasbo_dontCare (leave bytes as they are). Has meaning for RAW uncompressed streaming only. |
property streamByteOrderOutput: tunavclStreamByteOrder read f_outStreamByteOrder write f_outStreamByteOrder default unasbo_dontCare; |
|
Specifies how to analyze the byte order and position in data being sent when doing PCM raw streaming. It could leave bytes as they are, always swap, or autodetect the order. Default is unasbo_dontCare (leave bytes as they are). Has meaning for RAW uncompressed streaming only. |
property streamingMode: tunavclStreamingMode read f_streamingMode write f_streamingMode default unasm_VC; |
|
Specifies the low-level streaming mode. |
(c) 2012 Lake of Soft