diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/clistress/main.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/test/clistress/main.cpp b/src/test/clistress/main.cpp index 3f5038b..0869945 100644 --- a/src/test/clistress/main.cpp +++ b/src/test/clistress/main.cpp | |||
@@ -1,26 +1,5 @@ | |||
1 | #include "connection.h" | 1 | #include "connection.h" |
2 | 2 | ||
3 | void _waitForLength( Connection &con, int len) | ||
4 | { | ||
5 | int rlen = con.getInputAmnt(); | ||
6 | |||
7 | if (rlen >= len) | ||
8 | return; | ||
9 | |||
10 | int time_left = 5; | ||
11 | int mic_left = 0; | ||
12 | |||
13 | while (rlen < len) | ||
14 | { | ||
15 | if (time_left == 0 && mic_left == 0) | ||
16 | { | ||
17 | throw "Socket Timeout"; | ||
18 | } | ||
19 | con.readInput(time_left, mic_left, &time_left, &mic_left); | ||
20 | rlen = con.getInputAmnt(); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | int main() | 3 | int main() |
25 | { | 4 | { |
26 | Connection c; | 5 | Connection c; |
@@ -30,7 +9,7 @@ int main() | |||
30 | c.appendOutput("d"); | 9 | c.appendOutput("d"); |
31 | c.writeOutput(); | 10 | c.writeOutput(); |
32 | 11 | ||
33 | _waitForLength( c, 40 ); | 12 | c.waitForInput( 5, 40, 0 ); |
34 | 13 | ||
35 | c.close(); | 14 | c.close(); |
36 | 15 | ||