A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/66692ff497e928899d9709b883ca43d30ca96819 below:

[docs] Added an example for srt_getsockname API function. · Haivision/srt@66692ff · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+12

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+12

-0

lines changed Original file line number Diff line number Diff line change

@@ -1553,6 +1553,18 @@ port number after it has been autoselected.

1553 1553

| [`SRT_ENOCONN`](#srt_enoconn) | Socket [`u`](#u) isn't bound, so there's no local address to return <br/>(:warning: &nbsp; **BUG?** It should rather be [`SRT_EUNBOUNDSOCK`](#srt_eunboundsock)) |

1554 1554

| <img width=240px height=1px/> | <img width=710px height=1px/> |

1555 1555 1556 +

Example

1557 + 1558 +

```c++

1559 +

sockaddr_storage name;

1560 +

int namelen = sizeof sockaddr_storage;

1561 +

int res = srt_getsockname(m_listener_sock, (sockaddr*) &name, &namelen);

1562 +

// IPv4: namelen == sockaddr_in.

1563 +

// IPv6: namelen == sockaddr_in6.

1564 +

if (res < 0) {

1565 +

std::cerr << "Error " << srt_getlasterror_str() << '\n';

1566 +

}

1567 +

```

1556 1568 1557 1569

[:arrow_up: &nbsp; Back to List of Functions & Structures](#srt-api-functions)

1558 1570

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4