You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeReceiveMessage= int * WebSocketMessageType * IO.Stream * AsyncReplyChannel<Result<WebSocket.ReceiveStreamResult, ExceptionDispatchInfo>>
344
342
345
-
/// The ThreadSafeWebSocket record allows applications to send and receive data after the WebSocket upgrade has completed. This puts a `MailboxProcessor` in front of all send and receive messages to prevent multiple threads reading or writing to the socket at a time. Without this a websocket send/receive may throw a `InvalidOperationException` with the message: `There is already one outstanding 'SendAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.`
343
+
/// The ThreadSafeWebSocket record allows applications to send and receive data after the WebSocket upgrade has completed. This puts a `MailboxProcessor` in front of all send and receive messages to prevent multiple threads reading or writing to the socket at a time. Without this a websocket send/receive may throw a `InvalidOperationException` with the message:
344
+
///
345
+
/// `There is already one outstanding 'SendAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.`
346
346
typeThreadSafeWebSocket=
347
347
{ websocket :WebSocket
348
348
sendChannel :MailboxProcessor<SendMessages>
349
349
receiveChannel :MailboxProcessor<ReceiveMessage>
350
350
}
351
351
interface IDisposable with
352
+
/// Used to clean up unmanaged resources for ASP.NET and self-hosted implementations.
352
353
memberx.Dispose()=
353
354
x.websocket.Dispose()
355
+
/// Returns the current state of the WebSocket connection.
354
356
memberx.State=
355
357
x.websocket.State
358
+
/// Indicates the reason why the remote endpoint initiated the close handshake.
356
359
memberx.CloseStatus=
357
360
x.websocket.CloseStatus |> Option.ofNullable
361
+
///Allows the remote endpoint to describe the reason why the connection was closed.
358
362
memberx.CloseStatusDescription=
359
363
x.websocket.CloseStatusDescription
360
364
@@ -456,7 +460,7 @@ module ThreadSafeWebSocket =
456
460
457
461
/// **Description**
458
462
///
459
-
/// Reads an entire message from a websocket.
463
+
/// Reads an entire message from a websocket as a string.
460
464
///
461
465
/// **Parameters**
462
466
/// *`threadSafeWebSocket` - parameter of type `ThreadSafeWebSocket`
@@ -491,7 +495,7 @@ module ThreadSafeWebSocket =
491
495
match response with
492
496
| Ok (WebSocket.ReceiveStreamResult.Stream s)->return stream |> IO.MemoryStream.ToUTF8String |> WebSocket.ReceiveUTF8Result.String |> Ok
493
497
| Ok (WebSocket.Closed(status, reason))->
494
-
return Ok (WebSocket.ReceiveUTF8Result.StreamClosed(status, reason))
498
+
return Ok (WebSocket.ReceiveUTF8Result.Closed(status, reason))
0 commit comments