Skip to content

How do I close a TCP connection? #1635

Description

@tilongzs
  • My goal is: The server gets the message that the client is disconnected from the server.
  • My actions were: mg_close_conn(_currentConn);
  • My expectation was: The client executes mg_close_conn(conn); mg_mgr_free(mgr); code, and the server receives the MG_EV_CLOSE event.
  • The result I saw: The client executes mg_close_conn(conn); mg_mgr_free(mgr); code, the client receives the MG_EV_CLOSE event, but the server does not receive the MG_EV_CLOSE event. The server side receives the MG_EV_CLOSE event only when the client program is completely closed.
  • My question is: Which step am I missing?

Environment

  • mongoose version: 7.7
  • Compiler/IDE and SDK: Visual Studio 2022 (v143) Windows SDK 10.0.19041.0
  • Target hardware/board: Windows 11 X64(10.0.22000.795)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions