+12
-0
lines changedFilter options
+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: **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: 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