mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 20:26:00 +02:00
fcl-web: TCustomWSServer.OnDisconnect: pass TCustomWebsocketClient as Sender instead of connection
This commit is contained in:
parent
8ebced609c
commit
4c9f2b8b25
@ -248,7 +248,7 @@ Type
|
|||||||
Property OnAllow : TWSAllowConnectionEvent Read FOnAllow Write FOnAllow;
|
Property OnAllow : TWSAllowConnectionEvent Read FOnAllow Write FOnAllow;
|
||||||
// Called when a text message is received.
|
// Called when a text message is received.
|
||||||
property OnMessageReceived: TWSMessageEvent read FOnMessageReceived write FOnMessageReceived;
|
property OnMessageReceived: TWSMessageEvent read FOnMessageReceived write FOnMessageReceived;
|
||||||
// Called when a connection is disconnected. Sender is TWSServerConnection
|
// Called when a connection is disconnected. Sender is TCustomWebsocketClient
|
||||||
property OnDisconnect: TNotifyEvent read FOnDisconnect write FOnDisconnect;
|
property OnDisconnect: TNotifyEvent read FOnDisconnect write FOnDisconnect;
|
||||||
// Called when a control message is received.
|
// Called when a control message is received.
|
||||||
property OnControlReceived: TWSControlEvent read FOnControl write FOnControl;
|
property OnControlReceived: TWSControlEvent read FOnControl write FOnControl;
|
||||||
|
@ -271,7 +271,7 @@ begin
|
|||||||
If Assigned(MessagePump) then
|
If Assigned(MessagePump) then
|
||||||
MessagePump.RemoveClient(FConnection);
|
MessagePump.RemoveClient(FConnection);
|
||||||
If Assigned(OnDisconnect) then
|
If Assigned(OnDisconnect) then
|
||||||
OnDisconnect(Self);
|
OnDisconnect(FConnection);
|
||||||
// We cannot free the connection here, because it still needs to call it's own OnDisconnect.
|
// We cannot free the connection here, because it still needs to call it's own OnDisconnect.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ begin
|
|||||||
FConnection:=CreateClientConnection(FTransport);
|
FConnection:=CreateClientConnection(FTransport);
|
||||||
FConnection.OnMessageReceived:=@MessageReceived;
|
FConnection.OnMessageReceived:=@MessageReceived;
|
||||||
FConnection.OnControl:=@ControlReceived;
|
FConnection.OnControl:=@ControlReceived;
|
||||||
FCOnnection.OutgoingFrameMask:=Self.OutGoingFrameMask;
|
FConnection.OutgoingFrameMask:=Self.OutGoingFrameMask;
|
||||||
if UseSSL then
|
if UseSSL then
|
||||||
FSocket.Connect;
|
FSocket.Connect;
|
||||||
FActive:=True;
|
FActive:=True;
|
||||||
@ -470,7 +470,6 @@ begin
|
|||||||
FreeAndNil(FSocket);
|
FreeAndNil(FSocket);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCustomWebsocketClient.Disconnect(SendClose : boolean = true);
|
procedure TCustomWebsocketClient.Disconnect(SendClose : boolean = true);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user