tcpsocktimewait.c (157387) | tcpsocktimewait.c (157401) |
---|---|
1/*- 2 * Copyright (c) 2006 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2006 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c 157387 2006-04-02 00:07:38Z rwatson $ | 26 * $FreeBSD: head/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c 157401 2006-04-02 11:03:05Z rwatson $ |
27 */ 28 29/* 30 * TCP regression test that opens a loopback TCP session, then closes one end 31 * while shutting down the other. This triggers an unusual TCP stack case in 32 * which an open file descriptor / socket is associated with a closed TCP 33 * connection. 34 */ --- 121 unchanged lines hidden (view full) --- 156 tcp_client(parent_pid, 1); 157 158 parent_pid = getpid(); 159 child_pid = fork(); 160 if (child_pid < 0) 161 err(-1, "fork"); 162 if (child_pid == 0) { 163 child_pid = getpid(); | 27 */ 28 29/* 30 * TCP regression test that opens a loopback TCP session, then closes one end 31 * while shutting down the other. This triggers an unusual TCP stack case in 32 * which an open file descriptor / socket is associated with a closed TCP 33 * connection. 34 */ --- 121 unchanged lines hidden (view full) --- 156 tcp_client(parent_pid, 1); 157 158 parent_pid = getpid(); 159 child_pid = fork(); 160 if (child_pid < 0) 161 err(-1, "fork"); 162 if (child_pid == 0) { 163 child_pid = getpid(); |
164 tcp_server(child_pid); | 164 tcp_server(parent_pid); |
165 } else | 165 } else |
166 tcp_client(parent_pid, 800); | 166 tcp_client(child_pid, 800); |
167 168 return (0); 169} | 167 168 return (0); 169} |