Skip to content

Question about iolists #36

Open
Open
@ckampfe

Description

@ckampfe

Hey all, thanks for the library. I don't have an issue to report, just a question.

I see that the signature of encode, specifically for a {:binary, data} payload requires that data be a binary, via the is_binary guard in the is_friendly_frame guard:
https://github.com/elixir-mint/mint_web_socket/blob/main/lib/mint/web_socket/frame.ex#L67

Is this requirement for the data to be strictly a binary rather than iodata broadly due to something in the websocket protocol itself? I don't know the inner workings of the websocket protocol and I'm accustomed to using iolists via gentcp, etc., for performance, so I'm just curious if it would ever be possible to send an iolist in this library (or any others).

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions