Skip to content

feature: cosockets nonblocking listen accept feature#1393

Open
harijvs6 wants to merge 5 commits into
openresty:masterfrom
harijvs6:listen-api
Open

feature: cosockets nonblocking listen accept feature#1393
harijvs6 wants to merge 5 commits into
openresty:masterfrom
harijvs6:listen-api

Conversation

@harijvs6

@harijvs6 harijvs6 commented Oct 20, 2018

Copy link
Copy Markdown

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

Dynamically listen/accept socket in lua. Sample usage

location = / {
    access_by_lua_block {
            local function log(client_sock)
                    local reader = client_sock:receive(8)
                    if not data then
                        ngx.say("failed to read the data stream: ", err)
                    end
                    client_sock:send("welcome")
            end
            local socket = ngx.socket.tcp()
            local id = ngx.worker.id()
            local server = socket:bind("127.0.0.1",9190 + id)
            server:listen()
            if not server then
                    ngx.say("error : ", err)
                    return
            end
            ngx.header["content-type"] = "text/html"
            local client_sock = server:accept()
            log(client_sock)
            server:close()
    }
}

@mergify

mergify Bot commented Jun 26, 2020

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot removed the conflict label Sep 20, 2020
@harijvs6

Copy link
Copy Markdown
Author

@agentzh @spacewander Could you take a look at this and provide some high level feedback please

@mergify

mergify Bot commented Oct 10, 2020

Copy link
Copy Markdown

This pull request is now in conflict :(

@rainingmaster

Copy link
Copy Markdown
Member

@harijvs6 hi, could you add some test cases for this PR?

@mergify

mergify Bot commented Mar 20, 2023

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Mar 20, 2023
@mergify mergify Bot removed the conflict label May 10, 2023
@mergify

mergify Bot commented May 10, 2023

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label May 10, 2023
@mergify mergify Bot removed the conflict label Sep 23, 2023
@mergify

mergify Bot commented Sep 23, 2023

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Sep 23, 2023
@mergify mergify Bot removed the conflict label Mar 6, 2024
@mergify

mergify Bot commented Mar 6, 2024

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Mar 6, 2024
@mergify mergify Bot removed the conflict label May 27, 2024
@mergify

mergify Bot commented May 27, 2024

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label May 27, 2024
@mergify mergify Bot removed the conflict label Feb 13, 2025
@mergify

mergify Bot commented Feb 13, 2025

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Feb 13, 2025
@mergify mergify Bot removed the conflict label Jul 9, 2025
@mergify

mergify Bot commented Jul 9, 2025

Copy link
Copy Markdown

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants