TROSynapseServerSocket

Overview

The TROSynapseServerSocket class is a Synapse based server socket for accepting incoming connections. It uses a 'thread per connection' approach.

You can use this class to build a custom server application which uses proprietary protocols.

Location

 

constructor Create

Creates a new instance.

constructor Create

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. See the Binding Notice below.

property BindList: TStrings read write

IgnoreSSL

property IgnoreSSL: boolean read write

MaxThreads

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

property MaxThreads: Integer read write

OnGetMaxThreads

Allows additional processing when a value of the MaxThreads property is read.

property OnGetMaxThreads: TROGetMaxThreads read write
delegate: procedure OnGetMaxThreads(Sender: TObject; var aMaxThreads: integer)

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: TTCPBlockSocket)

OnNewSocket

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

property OnNewSocket: TRONewSocketEvent read write
delegate: function OnNewSocket(Sender: TObject; aSock: TSocket): TTCPBlockSocket

Port

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

property Port: Integer read write

Sock

Access to the TTCPBlockSocket which is used to listen to incoming connections.

property Sock: TTCPBlockSocket 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. See the Binding Notice below.

property BindList: TStrings read write

IgnoreSSL

property IgnoreSSL: boolean read write

MaxThreads

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

property MaxThreads: Integer read write

OnMaxThreadLimitReached

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

property OnMaxThreadLimitReached: TThreadMethod read write

Port

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

property Port: Integer read write

Sock

Access to the TTCPBlockSocket which is used to listen to incoming connections.

property Sock: TTCPBlockSocket read write

 

constructor Create

Creates a new instance.

constructor Create

 

OnGetMaxThreads

Allows additional processing when a value of the MaxThreads property is read.

property OnGetMaxThreads: TROGetMaxThreads read write
delegate: procedure OnGetMaxThreads(Sender: TObject; var aMaxThreads: integer)

OnNewConnection

Fires when a new client thread is started.

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

OnNewSocket

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

property OnNewSocket: TRONewSocketEvent read write
delegate: function OnNewSocket(Sender: TObject; aSock: TSocket): TTCPBlockSocket

See Also

  • Synapse