pascalSCADA OPM: sockets_unix

Pascal SCADA OPM

Unit sockets_unix

Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables

Description

{$DEFINE PORTUGUES} : Unix socket functions.

Overview

Functions and Procedures

function setblockingmode(fd:TSocket; mode:LongInt):LongInt;
function connect_with_timeout(sock:Tsocket; address:PSockAddr; address_len:t_socklen; timeout:LongInt):LongInt;
function connect_without_timeout(sock:Tsocket; address:PSockAddr; address_len:t_socklen):LongInt;
function socket_recv(sock:Tsocket; buf:PByte; len: Cardinal; flags, timeout: LongInt):LongInt;
function socket_send(sock:Tsocket; buf:PByte; len: Cardinal; flags, timeout: LongInt):LongInt;
function CheckConnection(var CommResult:TIOResult; var incRetries:Boolean; var FSocket:TSocket; CloseSocketProc:TConnectEvent; DoCommPortDisconected:TDisconnectNotifierProc):Boolean;
function WaitForConnection(FListenerSocket:TSocket; timeout:LongInt):Boolean;
function GetNumberOfBytesInReceiveBuffer(socket:Tsocket):LongInt;

Description

Functions and Procedures

function setblockingmode(fd:TSocket; mode:LongInt):LongInt;

: Sets the socket operation mode.

See also
MODE_NONBLOCKING
MODE_BLOCKING
function connect_with_timeout(sock:Tsocket; address:PSockAddr; address_len:t_socklen; timeout:LongInt):LongInt;

: Connect function with timeout. Their parameters are the same of the functions connect/fpconnect, with a extra parameter that is the maximum timeout of the connection establishment in milliseconds.

Returns

0 if the connection was estabilished successful.

function connect_without_timeout(sock:Tsocket; address:PSockAddr; address_len:t_socklen):LongInt;
 
function socket_recv(sock:Tsocket; buf:PByte; len: Cardinal; flags, timeout: LongInt):LongInt;

: Function that receive data of a socket. Their parameters are the same of the function recv/fprecv, with a extra parameter that is the maximum timout to receive all requested data on socket.

function socket_send(sock:Tsocket; buf:PByte; len: Cardinal; flags, timeout: LongInt):LongInt;

: Function that sends data through the socket. Their parameters are the same of the function send/fpsend, with a extra parameter that is the maximum timout to send all requested data.

function CheckConnection(var CommResult:TIOResult; var incRetries:Boolean; var FSocket:TSocket; CloseSocketProc:TConnectEvent; DoCommPortDisconected:TDisconnectNotifierProc):Boolean;

: Check the current connection state and updates the state of the communication port.

Returns

True if stills connected.

function WaitForConnection(FListenerSocket:TSocket; timeout:LongInt):Boolean;

: Waits for a incoming connection.

Returns

True if a incoming connection was done.

function GetNumberOfBytesInReceiveBuffer(socket:Tsocket):LongInt;

: Rerturn how many bytes are available on receive buffer.

Returns

A value bigger than zero if data are available on the receive buffer, zero if no data on the receive buffer and -1 on error.


Generated by PasDoc 0.14.0.