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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
113
114
116
123
124
125
144
145
146
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_ip.h"
#include "nx_tcp.h"
...
...
VOID _nx_tcp_socket_state_fin_wait2(NX_TCP_SOCKET *socket_ptr)
{
/* ... */
if ((socket_ptr -> nx_tcp_socket_fin_received) &&
(socket_ptr -> nx_tcp_socket_fin_sequence == 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;
socket_ptr -> nx_tcp_socket_rx_sequence++;
_nx_tcp_packet_send_ack(socket_ptr, socket_ptr -> nx_tcp_socket_tx_sequence);
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 ((socket_ptr -> nx_tcp_socket_fin_received) && (socket_ptr -> nx_tcp_socket_fin_sequence == socket_ptr -> nx_tcp_socket_rx_sequence)) { ... }
}{ ... }