Commit bfda813
committed
Set
While `tokio`'s `TcpListener::bind` sets `SO_REUSEADDR` by default, it
does *not* set `SO_REUSEPORT`, which means that rebinding exactly the
same addr/port tuple might still fail with OS err 98. Here, we set
`SO_REUSEPORT` on the `TcpSocket`, which however requires us to do the
listener setup manually, which we do in accordance to the `tokio` docs
(see https://docs.rs/exstd/latest/exstd/tokio/net/struct.TcpSocket.html)SO_REUSEPORT on listening sockets1 parent 8f39539 commit bfda813
1 file changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
347 | | - | |
| 349 | + | |
348 | 350 | | |
349 | 351 | | |
350 | 352 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 353 | + | |
| 354 | + | |
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
| |||
1835 | 1834 | | |
1836 | 1835 | | |
1837 | 1836 | | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
0 commit comments