mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-08 08:46:09 +00:00
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.
This commit is contained in:
@@ -1597,7 +1597,7 @@ int startControlStream(void) {
|
||||
|
||||
LC_ASSERT(ControlPortNumber != 0);
|
||||
|
||||
enet_address_set_address(&address, (struct sockaddr *)&RemoteAddr, RemoteAddrLen);
|
||||
enet_address_set_address(&address, (struct sockaddr *)&RemoteAddr, AddrLen);
|
||||
enet_address_set_port(&address, ControlPortNumber);
|
||||
|
||||
// Create a client
|
||||
@@ -1665,7 +1665,7 @@ int startControlStream(void) {
|
||||
else {
|
||||
// NB: Do NOT use ControlPortNumber here. 47995 is correct for these old versions.
|
||||
LC_ASSERT(ControlPortNumber == 0);
|
||||
ctlSock = connectTcpSocket(&RemoteAddr, RemoteAddrLen,
|
||||
ctlSock = connectTcpSocket(&RemoteAddr, AddrLen,
|
||||
47995, CONTROL_STREAM_TIMEOUT_SEC);
|
||||
if (ctlSock == INVALID_SOCKET) {
|
||||
stopping = true;
|
||||
|
||||
Reference in New Issue
Block a user