Опция SO_LINGER ― это настройка сокета в ядре ОС, Wireshark её не может показать напрямую, потому что она не передаётся по сети.
Но её эффект можно распознать по характеру завершения TCP-соединения:
Если SO_LINGER включён с таймаутом = 0
При close() приложение сразу рвёт соединение.
В захвате увидишь RST вместо обычного завершения по FIN.
When to use SO_LINGER with timeout 0 https://stackoverflow.com/questions/3757289/when-is-tcp-option-so-linger-0-required
Again, according to “UNIX Network Programming” third edition page 202-203, setting SO_LINGER with timeout 0 prior to calling close() will cause the normal termination sequence not to be initiated.
Instead, the peer setting this option and calling close() will send a RST (connection reset) which indicates an error condition and this is how it will be perceived at the other end. You will typically see errors like “Connection reset by peer”.
Therefore, in the normal situation it is a really bad idea to set SO_LINGER with timeout 0 prior to calling close() – from now on called abortive close – in a server application.
Why does Active Directory close LDAP connections with [RST, ACK] instead of [FIN, ACK]?
https://stackoverflow.com/questions/56194847/why-does-active-directory-close-ldap-connections-with-rst-ack-instead-of-fin
Когда TCP-сокеты отказываются умирать
https://habr.com/ru/articles/700470/
RFC:
https://datatracker.ietf.org/doc/html/rfc1337
.NET при создании LdapConnection открывает UDP-сокет на loopback (127.0.0.1).
Этот сокет используется внутренне библиотекой, в частности:
для реализации обработки Abandon / Cancel операций;
для внутреннего пробуждения потоков, ожидающих событий из сетевого стека (так называемый “wakeup socket” или “select trick”);
иногда для поддержки асинхронных уведомлений от сервера (LDAPv3 Controls).
Опция SO_LINGER ― это настройка сокета в ядре ОС, Wireshark её не может показать напрямую, потому что она не передаётся по сети.
Но её эффект можно распознать по характеру завершения TCP-соединения:
Если SO_LINGER включён с таймаутом = 0
При close() приложение сразу рвёт соединение.
В захвате увидишь RST вместо обычного завершения по FIN.
When to use SO_LINGER with timeout 0
https://stackoverflow.com/questions/3757289/when-is-tcp-option-so-linger-0-required
Again, according to “UNIX Network Programming” third edition page 202-203, setting SO_LINGER with timeout 0 prior to calling close() will cause the normal termination sequence not to be initiated.
Instead, the peer setting this option and calling close() will send a RST (connection reset) which indicates an error condition and this is how it will be perceived at the other end. You will typically see errors like “Connection reset by peer”.
Therefore, in the normal situation it is a really bad idea to set SO_LINGER with timeout 0 prior to calling close() – from now on called abortive close – in a server application.