Skip to content

Commit

Permalink
new about property
Browse files Browse the repository at this point in the history
  • Loading branch information
digao-dalpiaz committed Oct 26, 2020
1 parent 7027fe3 commit 75836e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DzSocket.pas
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ TDzTCPClient = class(TComponent)

Cache: TDzSocketCache;

FAbout: String;

FPort: Word;
FHost: String;

Expand Down Expand Up @@ -150,6 +152,8 @@ TDzTCPClient = class(TComponent)
property Connected: Boolean read GetConnected;
property SocketHandle: TSocket read GetSocketHandle;
published
property About: String read FAbout;

property Port: Word read FPort write FPort default 0;
property Host: String read FHost write FHost;

Expand All @@ -170,6 +174,8 @@ TDzTCPServer = class(TComponent)
private
S: TServerSocket;

FAbout: String;

FPort: Word;

FOnClientLoginCheck: TDzSocketLoginServerEvent;
Expand Down Expand Up @@ -219,6 +225,8 @@ TDzTCPServer = class(TComponent)

function FindSocketHandle(const ID: TSocket): TDzSocket;
published
property About: String read FAbout;

property Port: Word read FPort write FPort default 0;

property OnClientLoginCheck: TDzSocketLoginServerEvent read FOnClientLoginCheck write FOnClientLoginCheck;
Expand All @@ -244,6 +252,8 @@ implementation
uses System.SysUtils, Winapi.Winsock2, System.Generics.Collections,
System.Variants, System.JSON;

const STR_ABOUT = 'Digao Dalpiaz / Version 2.1';

procedure Register;
begin
RegisterComponents('Digao', [TDzTCPClient, TDzTCPServer]);
Expand Down Expand Up @@ -543,6 +553,7 @@ function TDzSocketEnumerator.MoveNext: Boolean;
constructor TDzTCPClient.Create(AOwner: TComponent);
begin
inherited;
FAbout := STR_ABOUT;
FKeepAliveInterval := DEF_KEEPALIVE_INTERVAL;
end;

Expand Down Expand Up @@ -690,6 +701,7 @@ procedure TDzTCPClient.DoInternalCmd(Socket: TDzSocket; const Cmd: Char; const D
constructor TDzTCPServer.Create(AOwner: TComponent);
begin
inherited;
FAbout := STR_ABOUT;
FKeepAliveInterval := DEF_KEEPALIVE_INTERVAL;

S := TServerSocket.Create(Self);
Expand Down

0 comments on commit 75836e5

Please sign in to comment.