1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
108
109
111
118
119
120
139
140
141
142
143
144
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_tcp.h"
#include "nx_ipv6.h"
...
...
VOID _nx_tcp_socket_state_closing(NX_TCP_SOCKET *socket_ptr, NX_TCP_HEADER *tcp_header_ptr)
{
if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)
{
if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence) &&
(tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence))
{
NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_TCP_STATE_CHANGE, socket_ptr -> nx_tcp_socket_ip_ptr, socket_ptr, socket_ptr -> nx_tcp_socket_state, NX_TCP_TIMED_WAIT, NX_TRACE_INTERNAL_EVENTS, 0, 0);
socket_ptr -> nx_tcp_socket_state = NX_TCP_TIMED_WAIT;
socket_ptr -> nx_tcp_socket_timeout = _nx_tcp_2MSL_timer_rate;
if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread)
{
_nx_tcp_socket_thread_resume(&(socket_ptr -> nx_tcp_socket_disconnect_suspended_thread), NX_SUCCESS);
}if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread) { ... }
/* ... */
if (socket_ptr -> nx_tcp_disconnect_callback)
{
/* ... */
(socket_ptr -> nx_tcp_disconnect_callback)(socket_ptr);
}if (socket_ptr -> nx_tcp_disconnect_callback) { ... }
#ifndef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT
if (socket_ptr -> nx_tcp_timed_wait_callback)
{
/* ... */
(socket_ptr -> nx_tcp_timed_wait_callback)(socket_ptr);
}if (socket_ptr -> nx_tcp_timed_wait_callback) { ... }
if (socket_ptr -> nx_tcp_disconnect_complete_notify)
{
(socket_ptr -> nx_tcp_disconnect_complete_notify)(socket_ptr);
}if (socket_ptr -> nx_tcp_disconnect_complete_notify) { ... }
/* ... */#endif
}if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence) && (tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence)) { ... }
}if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) { ... }
}{ ... }