mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 17:49:27 +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;
|
||||
// Called when a text message is received.
|
||||
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;
|
||||
// Called when a control message is received.
|
||||
property OnControlReceived: TWSControlEvent read FOnControl write FOnControl;
|
||||
|
@ -271,7 +271,7 @@ begin
|
||||
If Assigned(MessagePump) then
|
||||
MessagePump.RemoveClient(FConnection);
|
||||
If Assigned(OnDisconnect) then
|
||||
OnDisconnect(Self);
|
||||
OnDisconnect(FConnection);
|
||||
// We cannot free the connection here, because it still needs to call it's own OnDisconnect.
|
||||
end;
|
||||
|
||||
@ -294,7 +294,7 @@ begin
|
||||
FConnection:=CreateClientConnection(FTransport);
|
||||
FConnection.OnMessageReceived:=@MessageReceived;
|
||||
FConnection.OnControl:=@ControlReceived;
|
||||
FCOnnection.OutgoingFrameMask:=Self.OutGoingFrameMask;
|
||||
FConnection.OutgoingFrameMask:=Self.OutGoingFrameMask;
|
||||
if UseSSL then
|
||||
FSocket.Connect;
|
||||
FActive:=True;
|
||||
@ -470,7 +470,6 @@ begin
|
||||
FreeAndNil(FSocket);
|
||||
end;
|
||||
|
||||
|
||||
procedure TCustomWebsocketClient.Disconnect(SendClose : boolean = true);
|
||||
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user