SO_LINGER test
[corutils.git] / test_invalidconnect.c
bloba436804c889f69dd6a45575e75028746b89fbdbe
1 /**
2 * Connection oriented routing user space utils
3 * Copyright (C) 2009-2011
4 * Authors:
5 * Michael Blizek
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
23 #include <stdio.h>
24 #include <string.h>
26 #include "libcor.h"
28 int main(void)
30 int fd, rc;
32 char *addr = "ahugpykehegh";
34 fd = socket(PF_COR, 0, 0);
35 if (fd < 0) {
36 perror("socket");
37 return;
40 rc = connect(fd, 0, 0);
41 if (rc < 0) {
42 perror("connect");
43 return;
46 while (1) {
47 rc = send_connect_neigh(fd, strlen(addr), addr);
49 printf("send_connect_neigh rc = %d\n", rc);
51 rc = read_resp(fd);
53 printf("read_resp rc = %d\n", rc);
55 printf("we should now be stuck\n", rc);
58 return 0;