aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-03-17 12:02:52 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-17 12:07:19 +0100
commitd8c820570bd1c0da8a46b615930774319b8ae29b (patch)
tree8affb51ea5ad01638fe841e166b63dd77466a189
parentf2174ef1a21c5d213a951f210130f42359933eef (diff)
stream: Export osmo_stream_cli_reconnect()
In case the application is using the read-callback and a read returns 0, then the application itself would want to trigger the reconnect. This is different from the osmo_stream_cli_recv() case where the reconnect can be handled internally to the library. Change-Id: I41314bad4a9f44e8a61b9d2ba33d1a76b25bd145
-rw-r--r--include/osmocom/netif/stream.h1
-rw-r--r--src/stream.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 3981e41..819f1ce 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -44,6 +44,7 @@ void *osmo_stream_cli_get_data(struct osmo_stream_cli *cli);
struct osmo_fd *osmo_stream_cli_get_ofd(struct osmo_stream_cli *cli);
void osmo_stream_cli_set_connect_cb(struct osmo_stream_cli *cli, int (*connect_cb)(struct osmo_stream_cli *cli));
void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli));
+void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli);
struct osmo_stream_cli *osmo_stream_cli_create(void *ctx);
void osmo_stream_cli_destroy(struct osmo_stream_cli *cli);
diff --git a/src/stream.c b/src/stream.c
index 2fca7be..f5408f8 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -85,7 +85,7 @@ struct osmo_stream_cli {
void osmo_stream_cli_close(struct osmo_stream_cli *cli);
-static void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli)
+void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli)
{
if (cli->reconnect_timeout < 0) {
LOGP(DLINP, LOGL_DEBUG, "not reconnecting, disabled.\n");