diff options
author | Max <msuraev@sysmocom.de> | 2019-02-04 14:55:37 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2019-02-05 16:25:20 +0000 |
commit | 732652b5b7f4fe02ecfff5f33b67db6392b02617 (patch) | |
tree | d8ca95a8cdcb1aa538fe58d2b574fa4861fc4aad /examples | |
parent | a93bb2ca34a0b201c35a67445bb5b254ce5a3c5a (diff) |
Add socket name functions to stream client/server
Add functions to get the description of a server link or client
connection which examine data on corresponding socket.
Those functions use static buffers and intended for single use in
log/printf statements as illustarted by corresponding example changes.
Change-Id: If9a8e211da85956781479862a63c4fc6e53ed6be
Diffstat (limited to 'examples')
-rw-r--r-- | examples/stream-client.c | 2 | ||||
-rw-r--r-- | examples/stream-server.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/stream-client.c b/examples/stream-client.c index 6178dcd..e2fb901 100644 --- a/examples/stream-client.c +++ b/examples/stream-client.c @@ -39,7 +39,7 @@ void sighandler(int foo) static int connect_cb(struct osmo_stream_cli *conn) { - LOGP(DSTREAMTEST, LOGL_NOTICE, "connected\n"); + LOGP(DSTREAMTEST, LOGL_NOTICE, "connected: %s\n", osmo_stream_cli_get_sockname(conn)); return 0; } diff --git a/examples/stream-server.c b/examples/stream-server.c index b02eefe..c1086ec 100644 --- a/examples/stream-server.c +++ b/examples/stream-server.c @@ -171,7 +171,7 @@ int main(void) kbd_ofd->cb = kbd_cb; osmo_fd_register(kbd_ofd); - LOGP(DSTREAMTEST, LOGL_NOTICE, "Entering main loop\n"); + LOGP(DSTREAMTEST, LOGL_NOTICE, "Entering main loop on %s\n", osmo_stream_srv_link_get_sockname(srv)); while(1) { osmo_select_main(0); |