Question about iolists

Open
#36 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
elixir
Domain
networking

Research direction

Start in lib/mint/web_socket/frame.ex around the is_friendly_frame guard at line 67, then read the encode path for {:binary, data}. Determine whether the WebSocket protocol and this library can accept iodata; the issue does not specify an implementation, tests, or a definition of done.

Written by the indexing model from the issue text.

Description

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!

Dominant language
Elixir
Stars
151
Forks
17
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elixir-mint/mint_web_socket

All issues in elixir-mint/mint_web_socket

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.