TROServerSocket

Overview

Location

 

constructor Create    (declared in TROSocket)

Creates a new instance.

constructor Create

constructor Create (TROSocketMode)

Creates a new instance with a supplied value.

constructor Create(aMode: TROSocketMode)

Parameters:

  • aMode: Mode

AbortSocket    (declared in TROSocket)

procedure AbortSocket

Accept    (declared in TROSocket)

function Accept: THandle

Active

Reports if the server is now active or controls the server's state. If the server activates its binds socket with BindList addresses, it sets a socket in Listen mode and creates a thread to accept incoming connections.

property Active: Boolean read write

Bind    (declared in TROSocket)

procedure Bind(IP: string; Port: Word)

Parameters:

  • IP:
  • Port:

BindList

List of IP addresses on which the server accepts connections.

property BindList: TStrings read

CanRead  virtual    (declared in TROSocket)

function CanRead(aTimeout: Integer): Boolean

Parameters:

  • aTimeout:

CloseSocket    (declared in TROSocket)

procedure CloseSocket

Connect    (declared in TROSocket)

procedure Connect(IP: string; Port: Word)

Parameters:

  • IP:
  • Port:

CreateSocket    (declared in TROSocket)

procedure CreateSocket

ExceptCheck    (declared in TROSocket)

procedure ExceptCheck(aRaiseExcept: Boolean; aAbortSocket: Boolean)

Parameters:

  • aRaiseExcept:
  • aAbortSocket:

GetErrorDescEx    (declared in TROSocket)

function GetErrorDescEx: string

GetLocalSinIP    (declared in TROSocket)

function GetLocalSinIP: string

GetRemoteSinIP    (declared in TROSocket)

function GetRemoteSinIP: string

GetSins    (declared in TROSocket)

procedure GetSins

IsValidSocket    (declared in TROSocket)

function IsValidSocket: Boolean

LastError    (declared in TROSocket)

property LastError: Integer read

LastErrorDesc    (declared in TROSocket)

property LastErrorDesc: string read

Listen    (declared in TROSocket)

Establishes a socket to listen for an incoming connection.

procedure Listen(aBacklog: Integer)

Parameters:

  • aBacklog: Desired maximum length of the queue of pending connections. This value may be changed by the transport layer.

ListenQueue

Size of listen queue, by default = 15.

property ListenQueue: Cardinal read write

MaxThreads

Restricts the maximum connection (client threads) count (100 by default).

property MaxThreads: Integer read write

Mode    (declared in TROSocket)

property Mode: TROSocketMode read

NoDelay    (declared in TROSocket)

Controls TCP packet batching (Nagle's algorithm).
TCP normally batches small logical packets into single larger physical packets (by briefly delaying packets) to fill physical network frames with as much data as possible. This is intended to improve network throughput in terminal emulation environments where mostly keystrokes are being sent across the network. Setting NoDelay to true disables TCP packet batching. Disabling TCP packet batching means that packets are sent regardless of size; this increases the volume of network traffic.

property NoDelay: Boolean read write

OnMaxThreadLimitReached

Fires when an incoming connection is rejected due to the exceedance of the MaxThreads.

property OnMaxThreadLimitReached: TThreadMethod read write

OnNewConnection

Fires when a new client thread is started.

property OnNewConnection: TRONewConnection read write
delegate: procedure OnNewConnection(Sender: TObject; aSocket: TROSocket)

OnNewSocket

Fires when the server accepts a connection and allows to use a custom descendant of the TROSocket class to serve the client connection.

property OnNewSocket: TRONewSocketEvent read write
delegate: function OnNewSocket(Sender: TObject; aSock: THandle): TROSocket

OpenSSL    (declared in TROSocket)

Specifies SSL properties

property OpenSSL: TROOpenSSL read

OpenSSL_Connect    (declared in TROSocket)

procedure OpenSSL_Connect

Port

Used when the BindList is empty to bind to a Port on a default interface.

property Port: Integer read write

PreferIP4    (declared in TROSocket)

property PreferIP4: Boolean read write

RaiseExcept    (declared in TROSocket)

property RaiseExcept: Boolean read write

RecvBufferEx  virtual    (declared in TROSocket)

function RecvBufferEx(Buffer: Pointer; Len: Integer; aTimeout: Integer): Integer

Parameters:

  • Buffer:
  • Len:
  • aTimeout:

ResetLastError    (declared in TROSocket)

procedure ResetLastError

SendBuffer    (declared in TROSocket)

function SendBuffer(Buffer: Pointer; Len: Integer): Boolean

Parameters:

  • Buffer:
  • Len:

SockCheck    (declared in TROSocket)

function SockCheck(SockResult: Integer): Integer

Parameters:

  • SockResult:

Socket    (declared in TROSocket)

property Socket: THandle read write

 

Active

Reports if the server is now active or controls the server's state. If the server activates its binds socket with BindList addresses, it sets a socket in Listen mode and creates a thread to accept incoming connections.

property Active: Boolean read write

BindList

List of IP addresses on which the server accepts connections.

property BindList: TStrings read

LastError    (declared in TROSocket)

property LastError: Integer read

LastErrorDesc    (declared in TROSocket)

property LastErrorDesc: string read

ListenQueue

Size of listen queue, by default = 15.

property ListenQueue: Cardinal read write

MaxThreads

Restricts the maximum connection (client threads) count (100 by default).

property MaxThreads: Integer read write

Mode    (declared in TROSocket)

property Mode: TROSocketMode read

NoDelay    (declared in TROSocket)

Controls TCP packet batching (Nagle's algorithm).
TCP normally batches small logical packets into single larger physical packets (by briefly delaying packets) to fill physical network frames with as much data as possible. This is intended to improve network throughput in terminal emulation environments where mostly keystrokes are being sent across the network. Setting NoDelay to true disables TCP packet batching. Disabling TCP packet batching means that packets are sent regardless of size; this increases the volume of network traffic.

property NoDelay: Boolean read write

OnMaxThreadLimitReached

Fires when an incoming connection is rejected due to the exceedance of the MaxThreads.

property OnMaxThreadLimitReached: TThreadMethod read write

OpenSSL    (declared in TROSocket)

Specifies SSL properties

property OpenSSL: TROOpenSSL read

Port

Used when the BindList is empty to bind to a Port on a default interface.

property Port: Integer read write

PreferIP4    (declared in TROSocket)

property PreferIP4: Boolean read write

RaiseExcept    (declared in TROSocket)

property RaiseExcept: Boolean read write

Socket    (declared in TROSocket)

property Socket: THandle read write

 

constructor Create    (declared in TROSocket)

Creates a new instance.

constructor Create

constructor Create (TROSocketMode)

Creates a new instance with a supplied value.

constructor Create(aMode: TROSocketMode)

Parameters:

  • aMode: Mode

AbortSocket    (declared in TROSocket)

procedure AbortSocket

Accept    (declared in TROSocket)

function Accept: THandle

Bind    (declared in TROSocket)

procedure Bind(IP: string; Port: Word)

Parameters:

  • IP:
  • Port:

CanRead  virtual    (declared in TROSocket)

function CanRead(aTimeout: Integer): Boolean

Parameters:

  • aTimeout:

CloseSocket    (declared in TROSocket)

procedure CloseSocket

Connect    (declared in TROSocket)

procedure Connect(IP: string; Port: Word)

Parameters:

  • IP:
  • Port:

CreateSocket    (declared in TROSocket)

procedure CreateSocket

ExceptCheck    (declared in TROSocket)

procedure ExceptCheck(aRaiseExcept: Boolean; aAbortSocket: Boolean)

Parameters:

  • aRaiseExcept:
  • aAbortSocket:

GetErrorDescEx    (declared in TROSocket)

function GetErrorDescEx: string

GetLocalSinIP    (declared in TROSocket)

function GetLocalSinIP: string

GetRemoteSinIP    (declared in TROSocket)

function GetRemoteSinIP: string

GetSins    (declared in TROSocket)

procedure GetSins

IsValidSocket    (declared in TROSocket)

function IsValidSocket: Boolean

Listen    (declared in TROSocket)

Establishes a socket to listen for an incoming connection.

procedure Listen(aBacklog: Integer)

Parameters:

  • aBacklog: Desired maximum length of the queue of pending connections. This value may be changed by the transport layer.

OpenSSL_Connect    (declared in TROSocket)

procedure OpenSSL_Connect

RecvBufferEx  virtual    (declared in TROSocket)

function RecvBufferEx(Buffer: Pointer; Len: Integer; aTimeout: Integer): Integer

Parameters:

  • Buffer:
  • Len:
  • aTimeout:

ResetLastError    (declared in TROSocket)

procedure ResetLastError

SendBuffer    (declared in TROSocket)

function SendBuffer(Buffer: Pointer; Len: Integer): Boolean

Parameters:

  • Buffer:
  • Len:

SockCheck    (declared in TROSocket)

function SockCheck(SockResult: Integer): Integer

Parameters:

  • SockResult:

 

OnNewConnection

Fires when a new client thread is started.

property OnNewConnection: TRONewConnection read write
delegate: procedure OnNewConnection(Sender: TObject; aSocket: TROSocket)

OnNewSocket

Fires when the server accepts a connection and allows to use a custom descendant of the TROSocket class to serve the client connection.

property OnNewSocket: TRONewSocketEvent read write
delegate: function OnNewSocket(Sender: TObject; aSock: THandle): TROSocket