Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: cosockets nonblocking listen accept feature #1393

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

harijvs6
Copy link

@harijvs6 harijvs6 commented Oct 20, 2018

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
Copy link

mergify bot commented Jun 26, 2020

This pull request is now in conflict :(

@mergify mergify bot removed the conflict label Sep 20, 2020
@harijvs6
Copy link
Author

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

@mergify
Copy link

mergify bot commented Oct 10, 2020

This pull request is now in conflict :(

@rainingmaster
Copy link
Member

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

@mergify
Copy link

mergify bot commented Mar 20, 2023

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
Copy link

mergify bot commented May 10, 2023

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
Copy link

mergify bot commented Sep 23, 2023

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
Copy link

mergify bot commented Mar 6, 2024

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
Copy link

mergify bot commented May 27, 2024

This pull request is now in conflict :(

@mergify mergify bot added the conflict label May 27, 2024
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