From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Hans-Werner Hilse <hwhilse@gmail.com>
Subject: Re: [B.A.T.M.A.N.] [RFC] alfred: implement TCP support for server-to-server communication
Date: Mon, 21 Mar 2016 10:13:22 +0100 [thread overview]
Message-ID: <2352013.EmfB5eiPMC@bentobox> (raw)
In-Reply-To: <1458551033-8734-2-git-send-email-hwhilse@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 780 bytes --]
> +int connect_tcp(struct interface *interface, const struct in6_addr *dest)
> +{
> + struct sockaddr_in6 dest_addr;
> + int sock;
> +
> + memset(&dest_addr, 0, sizeof(dest_addr));
> + dest_addr.sin6_family = AF_INET6;
> + dest_addr.sin6_port = htons(ALFRED_PORT);
> + dest_addr.sin6_scope_id = interface->scope_id;
> + memcpy(&dest_addr.sin6_addr, dest, sizeof(*dest));
> +
> + sock = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP);
> + if (sock < 0)
> + return -1;
> +
> + if (connect(sock, (struct sockaddr *)&dest_addr,
> + sizeof(struct sockaddr_in6)) < 0) {
> + close(sock);
> + return -1;
> + }
> +
> + return sock;
> +}
> +
Wouldn't this hang for a while and make the alfred server "unresponsive"
when the remote is not reachable at this moment?.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-03-21 9:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-21 9:03 [B.A.T.M.A.N.] [RFC] alfred: implement TCP support for server-to-server Hans-Werner Hilse
2016-03-21 9:03 ` [B.A.T.M.A.N.] [RFC] alfred: implement TCP support for server-to-server communication Hans-Werner Hilse
2016-03-21 9:13 ` Sven Eckelmann [this message]
2016-03-21 9:38 ` Hans-Werner Hilse
2016-03-21 12:29 ` Simon Wunderlich
2016-03-21 13:25 ` Andrew Lunn
2016-03-27 18:26 ` [B.A.T.M.A.N.] [RFC v2] " Hans-Werner Hilse
2016-03-27 18:37 ` Hans-Werner Hilse
2016-04-22 18:37 ` jens
2016-04-24 22:02 ` Hans-Werner Hilse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2352013.EmfB5eiPMC@bentobox \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=hwhilse@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.