File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
22- #include " tcp_wrap.h"
22+ #include " tcp_wrap.h" // 1. Implementation header first
23+
24+ // 2. Windows System Headers (MUST BE BEFORE Node.js internals)
25+ #ifdef _WIN32
26+ #include < winsock2.h>
27+ #include < ws2tcpip.h>
28+ #endif
29+
30+ // 3. Node.js Internal Headers
2331#include " connect_wrap.h"
2432#include " connection_wrap.h"
2533#include " env-inl.h"
3139#include " stream_base-inl.h"
3240#include " stream_wrap.h"
3341#include " util-inl.h"
42+
43+ // 4. Standard C++ & POSIX Headers
3444#include < cerrno>
3545#include < cstdlib>
36- #ifdef _WIN32
37- #include < ws2tcpip.h>
38- #endif
46+
3947#ifndef _WIN32
40- #include < netinet/in.h>
48+ #include < netinet/in.h> // Required for IPPROTO_IP
49+ #include < netinet/ip.h> // Required for IP_TOS
50+ #include < netinet/ip6.h> // Required for IPV6_TCLASS
4151#include < sys/socket.h>
4252#endif
4353
You can’t perform that action at this time.
0 commit comments