Skip to content

Commit

Permalink
Update HTTP.WebSocketOn.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed Jun 29, 2024
1 parent 8fb0088 commit 2bbfcb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http/partials/Websocket/HTTP.WebSocketOn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class WebsocketOn : IHTTP.WebSocketOn
public EventHandler<WebSocketCloseStatus> OnClose { get; private set; }
public EventHandler<(byte[] buffer, HTTP.MessageType messageType)> OnData { get; private set; }
public EventHandler<Exception> OnError { get; private set; }
public EventHandler<(string name, byte[] buffer)> OnEvent { get; private set; }
public EventHandler<(string name, byte[] buffer, HTTP.MessageType messageType)> OnEvent { get; private set; }
public EventHandler<ClientWebSocket> OnModify { get; private set; }
public EventHandler OnOpen { get; private set; }

Expand Down Expand Up @@ -42,10 +42,10 @@ public void Data(Action<byte[], MessageType> callback)
Env.MainThread.Add(() => callback?.Invoke(@event.buffer, @event.messageType));
}

public void Event(Action<string, byte[]> callback)
public void Event(Action<string, byte[], MessageType> callback)
{
OnEvent += (@object, @event) =>
Env.MainThread.Add(() => callback?.Invoke(@event.name, @event.buffer));
Env.MainThread.Add(() => callback?.Invoke(@event.name, @event.buffer, @event.messageType));
}

public void Close(Action<WebSocketCloseStatus> callback)
Expand Down

0 comments on commit 2bbfcb0

Please sign in to comment.