Select one of the symbols to view example projects that use it.
 
Outline
...
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_tcp.h"
#include "nx_ipv6.h"
...
...
_nx_tcp_socket_block_cleanup(NX_TCP_SOCKET *)
Files
loading...
CodeScopeSTM32 Libraries and Samplesnetxduocommon/src/nx_tcp_socket_block_cleanup.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* */ /* This software is licensed under the Microsoft Software License */ /* Terms for Microsoft Azure RTOS. Full text of the license can be */ /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ /* and in the root directory of this software. */ /* */... /**************************************************************************/ ... /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Component */ /** */ /** Transmission Control Protocol (TCP) */ /** */... /**************************************************************************/ /**************************************************************************/ #define NX_SOURCE_CODE /* Include necessary system files. */ #include "nx_api.h" #include "nx_tcp.h" #include "nx_ipv6.h" ... /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_tcp_socket_block_cleanup PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function cleans up the transmission control block. */ /* */ /* INPUT */ /* */ /* socket_ptr Pointer to owning socket */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* None */ /* */ /* CALLED BY */ /* */ /* _nx_tcp_fast_periodic_processing Process TCP packet for socket */ /* _nx_tcp_socket_connection_reset Reset TCP connection */ /* _nx_tcp_socket_disconnect Close TCP conenction */ /* _nx_tcp_socket_state_last_ack Process data on LAST ACK state*/ /* _nx_tcp_client_socket_unbind Ubind the TCP client socket */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ /* */... /**************************************************************************/ VOID _nx_tcp_socket_block_cleanup(NX_TCP_SOCKET *socket_ptr) { /* Clean up the connect IP address. */ socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_version = 0; #ifdef FEATURE_NX_IPV6 /* Clean up the IP address field. */ SET_UNSPECIFIED_ADDRESS(socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_address.v6);/* ... */ #else /* FEATURE_NX_IPV6 */ socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_address.v4 = 0; #endif /* FEATURE_NX_IPV6 */ /* Clean up the connect port. */ socket_ptr -> nx_tcp_socket_connect_port = 0; /* Reset zero window probe flag. */ socket_ptr -> nx_tcp_socket_zero_window_probe_has_data = NX_FALSE; /* Simply clear the timeout. */ socket_ptr -> nx_tcp_socket_timeout = 0; /* Reset duplicated ack received. */ socket_ptr -> nx_tcp_socket_duplicated_ack_received = 0; /* Reset fast recovery stage. */ socket_ptr -> nx_tcp_socket_fast_recovery = NX_FALSE; /* Connection needs to be closed down immediately. */ if (socket_ptr -> nx_tcp_socket_client_type) { /* If trace is enabled, insert this event into the trace buffer. */ 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_CLOSED, NX_TRACE_INTERNAL_EVENTS, 0, 0); /* Client socket, return to a CLOSED state. */ socket_ptr -> nx_tcp_socket_state = NX_TCP_CLOSED; }if (socket_ptr -> nx_tcp_socket_client_type) { ... } else { /* If trace is enabled, insert this event into the trace buffer. */ 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_LISTEN_STATE, NX_TRACE_INTERNAL_EVENTS, 0, 0); /* Server socket, return to LISTEN state. */ socket_ptr -> nx_tcp_socket_state = NX_TCP_LISTEN_STATE; }else { ... } }{ ... }