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

ngx.socket.tcp receive bsd style

Open brg-liuwei opened this issue 9 years ago • 12 comments

Implement bsd style receive('*b') for ngx.socket.tcp, and add a simple test case in file t/137-tcp-socket-receive-bsd-style.t

春哥好,今天看到openresty邮件列表里面有关于BSD风格的receive的讨论,我印象中关于这个主题在邮件列表里面已经多次出现了。因此一时兴起写了实现了这个接口,并附上一个简单的测试文件(对Test::Nginx的语法还不完全了解,所以只写一个最简单的test case)。目前还没有去在openresty的文档中添加使用方法,如果这个PR被接受,我再去补充文档,到时候再提交一个PR。英文学得不好,表达不够native,因此前面仅用一段简单的英语做描述,不知道是否符合规范?希望能得到春哥的指点,谢谢。

brg-liuwei avatar Aug 30 '16 15:08 brg-liuwei

@brg-liuwei Seems like your branch fails the Travis CI testing:

https://travis-ci.org/openresty/stream-lua-nginx-module/builds/156263654

And also see below in this ticket's web UI.

Your branch does not even compile. Will you fix that first?

agentzh avatar Aug 30 '16 20:08 agentzh

@brg-liuwei It is useful and it works well, thank you. Do you mind making another pull request to lua-nginx-module ? I'd like to see cosocket in http supporting bsd style receive.

mike07026 avatar Sep 02 '16 06:09 mike07026

@mike07026 Ok, I'm very glad to make another PR to lua-nginx-module. I will accomplish it soon, please wait a moment.

brg-liuwei avatar Sep 02 '16 07:09 brg-liuwei

@doujiang24 @cuiweixie @yangshuxin Will you have a look at this for me? Many thanks!

agentzh avatar Sep 03 '16 18:09 agentzh

I have used the api tcpsock:receive('*b') on the repo lua-resty-socks5-server and works well for socks5 server until now:)

detailyang avatar Oct 06 '16 07:10 detailyang

when will those PRs to be merged to master? @agentzh @brg-liuwei

shancci avatar Nov 26 '16 03:11 shancci

when will those PRs to be merged to master? @agentzh :)

brg-liuwei avatar Jan 22 '17 14:01 brg-liuwei

@brg-liuwei I suggest adding this feature to ngx_http_lua_module first since we usually sync changes in only one direction (i.e., from ngx_http_lua to ngx_stream_lua), not both :)

agentzh avatar Jan 22 '17 20:01 agentzh

Oops! it seems that the #refactor# break all pull codes. @brg-liuwei

shancci avatar Oct 28 '17 02:10 shancci

Why didn't I find *b parameter in v0.0.6rc3 version? @brg-liuwei

yigangbupt avatar Jan 07 '19 06:01 yigangbupt

I think we are going for the receive_any() route now? @spacewander What's your plan please?

agentzh avatar Feb 04 '19 01:02 agentzh

I will port the receive_any() from the lua-nginx-module once I have free time.

spacewander avatar Feb 11 '19 02:02 spacewander