SO_LINGER test
[corutils.git] / test_connect.c
blob0f296de2261b4a2b487c0cf4a47e93e62ad96d35
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>
25 #include "libcor.h"
27 int main(void)
29 int fd, rc;
31 fd = socket(PF_COR, 0, 0);
32 printf("socket\n");
33 if(fd < 0) {
34 perror("socket");
35 goto early_out;
38 rc = connect(fd, 0, 0);
39 printf("connect\n");
40 if(rc < 0) {
41 perror("connect");
42 goto out;
45 rc = send_connect_port(fd, 1);
47 printf("send_connect %d\n", rc);
49 rc = read_resp(fd);
51 printf("rc = %d");
53 out:
54 close(fd);
56 early_out:
57 //sleep(10);
59 return 0;