|
|
| 53 |
bool m_windowUpdated; |
53 |
bool m_windowUpdated; |
| 54 |
bool m_senderFinished; |
54 |
bool m_senderFinished; |
| 55 |
bool m_receiverFinished; |
55 |
bool m_receiverFinished; |
|
|
56 |
bool m_sentUpdate; |
| 56 |
}; |
57 |
}; |
| 57 |
|
58 |
|
| 58 |
TcpZeroWindowTest::TcpZeroWindowTest (const std::string &desc) |
59 |
TcpZeroWindowTest::TcpZeroWindowTest (const std::string &desc) |
|
Lines 60-66
TcpZeroWindowTest::TcpZeroWindowTest (const std::string &desc)
|
Link Here
|
|---|
|
| 60 |
m_zeroWindowProbe (false), |
61 |
m_zeroWindowProbe (false), |
| 61 |
m_windowUpdated (false), |
62 |
m_windowUpdated (false), |
| 62 |
m_senderFinished (false), |
63 |
m_senderFinished (false), |
| 63 |
m_receiverFinished (false) |
64 |
m_receiverFinished (false), |
|
|
65 |
m_sentUpdate (false) |
| 64 |
{ |
66 |
{ |
| 65 |
} |
67 |
} |
| 66 |
|
68 |
|
|
Lines 154-163
TcpZeroWindowTest::Tx (const Ptr<const Packet> p, const TcpHeader &h, SocketWho
|
Link Here
|
|---|
|
| 154 |
{ |
156 |
{ |
| 155 |
NS_FATAL_ERROR ("No packets should be sent before the window update"); |
157 |
NS_FATAL_ERROR ("No packets should be sent before the window update"); |
| 156 |
} |
158 |
} |
| 157 |
else if (Simulator::Now ().GetSeconds () >= 10.0) |
159 |
else if (Simulator::Now ().GetSeconds () >= 10.0 && !m_sentUpdate) |
| 158 |
{ |
160 |
{ |
| 159 |
NS_TEST_ASSERT_MSG_EQ (h.GetWindowSize (), 2500, |
161 |
NS_TEST_ASSERT_MSG_EQ (h.GetWindowSize (), 2500, |
| 160 |
"Receiver window not updated"); |
162 |
"Receiver window not updated"); |
|
|
163 |
m_sentUpdate = true; |
| 161 |
} |
164 |
} |
| 162 |
} |
165 |
} |
| 163 |
|
166 |
|
|
Lines 180-186
TcpZeroWindowTest::Rx (const Ptr<const Packet> p, const TcpHeader &h, SocketWho
|
Link Here
|
|---|
|
| 180 |
"RECEIVER window size is not 0 in the SYN-ACK"); |
183 |
"RECEIVER window size is not 0 in the SYN-ACK"); |
| 181 |
} |
184 |
} |
| 182 |
|
185 |
|
| 183 |
if (Simulator::Now ().GetSeconds () >= 10.0) |
186 |
if (Simulator::Now ().GetSeconds () >= 10.0 && !m_windowUpdated) |
| 184 |
{ |
187 |
{ |
| 185 |
NS_TEST_ASSERT_MSG_EQ (h.GetWindowSize (), 2500, |
188 |
NS_TEST_ASSERT_MSG_EQ (h.GetWindowSize (), 2500, |
| 186 |
"Receiver window not updated"); |
189 |
"Receiver window not updated"); |