Cameron Gutman
8599b6042a
Use SO_NONBLOCK on Haiku
2024-06-10 23:45:51 -05:00
Cameron Gutman
c245fe599d
Use higher packet size for remote streaming over end-to-end IPv6 connection
...
The IPv6 spec guarantees a minimum of 1280 byte MTUs
2024-05-29 13:57:50 -04:00
GaryOderNichts
3d99869c0c
Implement support for userbuffers on Wii U
...
The Wii U socket implementation has limited memory available. To support larger receive buffers, application memory needs to be provided.
To make sockets use this user memory the `SO_RUSRBUF` option needs to be set on the socket.
2024-02-18 13:39:17 -06:00
zoeyjodon
35f730fedd
Improve 3DS Reliability ( #87 )
...
- Simplifies thread priority setup
- Sets a max socket buffer size of 0x20000 for the 3DS
- Fixes a bug with polling timeouts taking longer than intended
- Removes 3DS global socket definition
2024-02-02 18:33:18 -06:00
Cameron Gutman
c0e3dc64a4
Add basic QoS attributes to our A/V sockets
2024-02-01 00:15:47 -06:00
zoey jodon
c104a97fa0
Add platform support for the 3DS
...
Prevent wildcard port binding on the 3DS
Add 3DS threading logic
Add 3DS socket logic
Bump the connection timeout to 60s for the 3DS
2024-01-18 18:30:20 -06:00
Elia Zammuto
7f99bebc72
UWP Changes ( #85 )
2024-01-15 16:36:28 -06:00
Cameron Gutman
bbf15af837
Revert "Use connected datagram sockets for audio and video"
...
This causes problems on multi-homed GFE and Sunshine (prior to v0.21) hosts
because audio and video data can be sent back from an address different than
the one we used as our original destination address.
This reverts commit c13f4a323f .
2023-10-26 01:15:27 -05:00
Cameron Gutman
05c3f9c754
Bind our UDP sockets to the same local address used by RTSP handshake
...
This means we can ensure a consistent local address for our outgoing PING
traffic to keep the UDP flows alive without having to call connect() which breaks
with multi-homed hosts on GFE and Sunshine v0.20 and earlier.
2023-10-26 01:09:26 -05:00
Cameron Gutman
8b84d17c8d
Replace additional unsafe string functions
2023-10-06 17:33:37 -05:00
Cameron Gutman
c13f4a323f
Use connected datagram sockets for audio and video
...
This ensures unwanted data from other sources is dropped and that our own source address doesn't change while streaming.
2023-09-12 23:29:05 -05:00
Cameron Gutman
77c5d5c282
Tune SO_RCVBUF logic
...
- Calculate desired SO_RCVBUF by packet size for the video socket
- Use the OS default SO_RCVBUF for audio and STUN sockets
2023-07-25 18:30:19 -05:00
Cameron Gutman
be1a48e856
Treat WSA_IO_PENDING as a receive timeout
2023-02-13 20:20:44 -06:00
Sunguk Lee
c6d68d9e87
vita: Reduce TCPv4_MSS to 512 to avoid setsockopt error
...
`setsockopt` with 536 returned EINVAL error.
SCE would use simple value for limit
2022-01-24 22:19:09 -06:00
Sunguk Lee
4a4a23c7c4
vita: Replace select to poll
...
now newlib support [this][1]
[1]: https://github.com/vitasdk/newlib/pull/70
2022-01-24 22:16:59 -06:00
Mariotaku
5ed9a6508a
Fixed build issue with MinGW ( #64 )
2021-09-16 01:30:47 -05:00
Cameron Gutman
2660a05084
Fix GCC build
2021-07-01 22:28:17 -05:00
Cameron Gutman
52250b4815
Use O_NONBLOCK for platforms without support for FIONBIO
2021-07-01 22:15:26 -05:00
Cameron Gutman
c00f4e15ae
Use poll() instead of SO_RCVTIMEO for RTSP timeout support
...
poll() is more portable than SO_RCVTIMEO
2021-07-01 22:10:46 -05:00
GaryOderNichts
e5b39af6a5
some Wii U changes
2021-06-05 01:59:58 +02:00
GaryOderNichts
0c66a50e2d
Wii U platform support
2021-06-04 21:36:54 +02:00
Cameron Gutman
122ce4a568
Enable SO_RCVTIMEO for RTP sockets on Windows
2021-05-25 20:38:30 -05:00
Cameron Gutman
8f371343cd
Consolidate includes
2021-04-29 17:22:15 -05:00
Cameron Gutman
da68e64d9b
Fix various MSVC warnings
2021-04-29 17:21:12 -05:00
Cameron Gutman
252a50bb75
Disable WSAECONNRESET errors for UDP sockets on Windows
2021-04-28 20:37:20 -05:00
Cameron Gutman
c1befbe2a8
Improve audio resync logic to use initial receive time rather send time
2021-04-26 22:43:49 -05:00
Cameron Gutman
3979dbd082
Allow compilation on OSes without IPv6 support
2021-04-17 23:40:36 -05:00
Cameron Gutman
a64af8d8cf
Fix unused variable warning on NaCl
2021-01-09 20:08:22 -06:00
Cameron Gutman
5f9f7ce407
Code cleanup: use stdbool.h
2020-11-30 20:38:13 -06:00
Cameron Gutman
f15582a090
Update pollSockets() fallback for Vita compatibility
2020-10-22 17:20:07 -05:00
Cameron Gutman
dbedf938d4
Don't require linking to wlanapi.dll
...
This is not always available on Windows Server
2020-09-08 18:26:36 -07:00
Cameron Gutman
128c1503f2
Don't perform the connection test in resolveHostName() for single addresses unless required
2020-09-06 17:11:14 -07:00
Cameron Gutman
6ca0b93809
Ignore ICMP Port Unreachable messages on our UDP sockets
...
These messages can falsely indicate failure in cases where the UDP socket
for audio or video hasn't opened yet when we start to send our PING packets.
It is also problematic when sending STUN requests to multiple IP addresses.
If one returns an ICMP Port Unreachable, it can cause us to fail the entire set
of requests even when other IP addresses do respond.
2020-09-06 14:04:57 -07:00
Cameron Gutman
38fe65f8bd
Remove unused variable
2020-08-29 21:09:35 -07:00
Cameron Gutman
a89fcb8a46
Always use the test port
2020-08-29 19:14:53 -07:00
Cameron Gutman
9064d4931f
Add createSocket() helper to reduce code duplication
2020-08-29 18:54:11 -07:00
Cameron Gutman
5ddd53e17f
Enable media streaming mode for 802.11 WLAN interfaces on Windows
2020-08-11 22:12:58 -07:00
Cameron Gutman
117a7c637f
Switch to poll() to be safe against stack corruption from exceeding FD_SETSIZE
...
Fortunately, the fd_set definition is not prone to stack corruption on Windows,
because FD_SETSIZE is the maximum number of sockets in a fd_set, not
the maximum value socket file descriptor that can be stored in a fd_set.
https://beesbuzz.biz/code/5739-The-problem-with-select-vs-poll
2020-07-26 20:27:58 -07:00
Cameron Gutman
e938d84cdb
Use TCP_NOOPT to restrict MSS on BSD-based OSes
2019-12-01 15:22:18 -08:00
Cameron Gutman
ceab64c46b
Use IP_PMTUDISC_DONT to clamp MSS on Windows
2019-12-01 15:00:21 -08:00
Cameron Gutman
52f489bc46
Fix RTSP handshake errors on networks with broken PMTUD
2019-11-30 21:19:56 -06:00
Sunguk Lee
021a1b23e9
vita: Enable nonblock TCP socket
2019-11-04 02:47:41 +09:00
Cameron Gutman
25528671d2
Fix error value on control stream and RTSP handshake failure
2019-11-02 21:28:05 -07:00
Cameron Gutman
197594f38c
Add platform helper function to set socket non-blocking mode
2019-11-02 19:16:46 -07:00
Cameron Gutman
ea135be05a
Only test TCP ports if the hostname resolves to multiple addresses
2019-10-12 19:09:28 -07:00
Sunguk Lee
a5c1054742
vita: Remove more vita specific branches
2019-10-05 20:07:41 +09:00
Sunguk Lee
787700ca50
vita: Use getaddrinfo instead gethostbyname
2019-08-14 01:25:04 +09:00
Cameron Gutman
25dfbcfd41
Implement isPrivateNetworkAddress() for IPv6
2019-07-15 00:16:17 -07:00
Cameron Gutman
639ff18dbb
Allow automatic detection of remote streaming
2018-11-21 20:52:50 -08:00
Cameron Gutman
396b02a94d
Test each address returned in the getaddrinfo() call and stop blindly preferring IPv4
...
Fixes NAT64 on iOS 12 and probably other obscure configurations
2018-11-16 00:37:38 -08:00