0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mruby on YABMにhttpサーバを入れてみた

Last updated at Posted at 2025-08-18

LwIPのraw methodのtcpechoのコードを参考にしてhttpサーバ機能を入れてみました。

設定したレスポンスデータを返すだけの機能しかありません。

image.png

すべてのYABMのアーキテクチャに反映済みです。

LwIPのpbufのサイズは16bitなので64kが一回の処理の最大値です。これを越えるようなサイズを返したい場合は、なんらか追加の処理が必要と思われます。とりあえずレスポンスデータのバッファは32Kにしてあります。

リクエストに対してmrubyで処理できるのがいいのかもしれませんが、LwIPの仕組み的に難しいです。

とりあえず一つのレスポンスだけのサポートを作りましたが、将来複数のレスポンスが返せるように作れたらいいな。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?