diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-07-05 14:05:40 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-07-05 14:07:25 +0200 |
commit | ac33f6fbd2d55b0eb52b42e0d466be4c39914020 (patch) | |
tree | bb51b8681aa71137a1bbdfbb0baf818d8c9af45c /src/stream.c | |
parent | e2fbd3dee43bb3d47c53514200650db41b4f5ef7 (diff) |
stream.c: Use non-blocking connect in osmo_stream_cli
When establishing a client-side stream connection via libosmo-netif,
we must using non-blocking connect if we want to avoid blocking/stalling
the entire process. The libosmocore socket API provides the
OSMO_SOCK_F_NONBLOCK flag for this. Make use of it!
Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6
Related: OS#3383
Diffstat (limited to 'src/stream.c')
-rw-r--r-- | src/stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream.c b/src/stream.c index 9dcb94b..6eb2313 100644 --- a/src/stream.c +++ b/src/stream.c @@ -451,7 +451,7 @@ int osmo_stream_cli_open2(struct osmo_stream_cli *cli, int reconnect) ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto, cli->local_addr, cli->local_port, cli->addr, cli->port, - OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND); + OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) { if (reconnect) osmo_stream_cli_reconnect(cli); |