Skip to content

Commit c5cb606

Browse files
committed
fixed the build failure
1 parent 648a6c3 commit c5cb606

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/WebSocket4Net/WebSocket.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,20 @@ private void WriteHandshakeRequest(PipeWriter writer, string secKey)
224224
writer.Write("\r\n", _asciiEncoding);
225225
}
226226

227-
public new void StartReceive()
227+
public void StartReceive()
228228
{
229229
if (State != WebSocketState.Open)
230230
{
231231
throw new InvalidOperationException($"You cannot call the method {nameof(StartReceive)} when the websocket connection is not open.");
232232
}
233233

234-
base.StartReceive();
235-
_packageHandlerMode = true;
234+
StartReceiveAsync().ContinueWith(t =>
235+
{
236+
if (t.IsFaulted)
237+
{
238+
OnError("Receive error", t.Exception);
239+
}
240+
}, TaskContinuationOptions.OnlyOnFaulted);
236241
}
237242

238243
public new async ValueTask<WebSocketPackage> ReceiveAsync()

0 commit comments

Comments
 (0)