stream-lua-nginx-module icon indicating copy to clipboard operation
stream-lua-nginx-module copied to clipboard

tcpsock:receive needs stream reading pattern

Open mike07026 opened this issue 9 years ago • 4 comments

Now tcpsock:receive now support two pattern '_a' and '_l'(default '*l' if pattern is nil), it's quite useful in text-based protocol or open binary protocol(eg. Mysql).

But to deal with non-public protocol, we need stream reading pattern, return anything once socket receives.

For example, we hava a decode library(.so/.dll) privided by others who don't open their protocol, and we need to fill socket data into the library to decode message out. Without steam reading pattern, decode can't be done in efficient way (done by tcpsock:receive(1) loop).

I suggest to add stream reading pattern into tcpsock:receive, especially in stream-lua-nginx-module

mike07026 avatar Aug 30 '16 01:08 mike07026

@mike07026 Understood and it's been on the TODO list already. And @brg-liuwei is already working on a patch for it. See #33.

agentzh avatar Aug 30 '16 20:08 agentzh

@mike07026 Understood and it's been on the TODO list already. And @brg-liuwei is already working on a patch for it. See #33.

sorry, is the patch in effect? Why didn't I find in v0.0.6rc3 version?

yigangbupt avatar Jan 07 '19 07:01 yigangbupt

BSD-style receiveany() was introduced in lua-nginx-module v0.10.14, but not ported to this repo.

shancci avatar Mar 15 '19 06:03 shancci

@shancci Indeed. Just found this out myself. Unfortunately this isnt really covered by the documentation.

@agentzh Is there a specific reason that this function has not been ported (I mean other than time / priorities)?

splitice avatar Jun 08 '19 11:06 splitice