Skip to content
FutureBlitz

    Install

    Import std.net.ws.websocket

    WebSocketMessage

    std.net.ws.websocket

    struct

    Public Struct WebSocketMessage Implements Printable

    A WebSocket's message: text, which is UTF-8, or bytes.

    Examples

    Local message = WebSocketMessage(True, "hi".Bytes)
    Expect(message.IsText && message.Text == "hi")

    std/net/ws/websocket.fb, line 49

    • Public ReadOnly Field IsText: Bool field #

      Whether it's text, or bytes.

    • Public ReadOnly Field Bytes: UInt8[] field #

      Its bytes: a text message's UTF-8.

    • Public New(isText: Bool, bytes: UInt8[]) constructor #

      A message of bytes, text when isText.

    • Public Property Text: String property #

      Its text: a text message's, or a binary one's bytes as UTF-8, or "" when they aren't.

    • Public Method ToString(): String method #

      A text message's text, or how many bytes a binary one has.

    Report an issue with this page or with FutureBlitz on GitHub.