Skip to content

nng_socket_close may hang on windows #2102

Open
@Red-Li

Description

Describe the bug
nng_socket_close may hang on window in some situations, from the call stack, it is waiting for pipe close.

while (!nni_list_empty(&sock->s_pipes)) {

Expected behavior
It should return normally

Actual Behavior
Hang

To Reproduce
Possible reproduce senario:
Create IPC/pair socket, but don't send any data for a period large than 5 seconds, and then close the socket.

** Environment Details **

  • NNG Version: latest(v2.0)
  • Windows 10
  • Visual Studio 2022
  • Static

Additional context
from my debugging, there is a issue in IOCP worker, timeout error does not handle correctly, which cause it exit unexpected.

if (olpd == NULL) {

Potential Fix has attached

winio.patch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions