mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Update the ENet API to support IPv6
This commit is contained in:
parent
c03692c908
commit
5a92f72012
2
enet
2
enet
@ -1 +1 @@
|
||||
Subproject commit 4f7ef11c2352dc53539d1ff93887ef637a6c2e2f
|
||||
Subproject commit 8b24595dbd9ad0a026edf2047b4d1eaceaf09123
|
@ -591,19 +591,24 @@ int startControlStream(void) {
|
||||
if (ServerMajorVersion >= 5) {
|
||||
ENetAddress address;
|
||||
ENetEvent event;
|
||||
|
||||
// This will do DNS resolution if required
|
||||
if (enet_address_set_host(&address, RemoteAddrString) < 0) {
|
||||
return -1;
|
||||
}
|
||||
enet_address_set_port(&address, 47999);
|
||||
|
||||
// Create a client that can use 1 outgoing connection and 1 channel
|
||||
client = enet_host_create(NULL, 1, 1, 0, 0);
|
||||
client = enet_host_create(address.address.ss_family, NULL, 1, 1, 0, 0);
|
||||
if (client == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
enet_address_set_host(&address, RemoteAddrString);
|
||||
enet_address_set_port(&address, 47999);
|
||||
|
||||
// Connect to the host
|
||||
peer = enet_host_connect(client, &address, 1, 0);
|
||||
if (peer == NULL) {
|
||||
enet_host_destroy(client);
|
||||
client = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -611,6 +616,10 @@ int startControlStream(void) {
|
||||
if (enet_host_service(client, &event, CONTROL_STREAM_TIMEOUT_SEC * 1000) <= 0 ||
|
||||
event.type != ENET_EVENT_TYPE_CONNECT) {
|
||||
Limelog("RTSP: Failed to connect to UDP port 47999\n");
|
||||
enet_peer_reset(peer);
|
||||
peer = NULL;
|
||||
enet_host_destroy(client);
|
||||
client = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -452,15 +452,18 @@ int performRtspHandshake(void) {
|
||||
ENetAddress address;
|
||||
ENetEvent event;
|
||||
|
||||
// This will do DNS resolution if required
|
||||
if (enet_address_set_host(&address, RemoteAddrString) < 0) {
|
||||
return -1;
|
||||
}
|
||||
enet_address_set_port(&address, 48010);
|
||||
|
||||
// Create a client that can use 1 outgoing connection and 1 channel
|
||||
client = enet_host_create(NULL, 1, 1, 0, 0);
|
||||
client = enet_host_create(address.address.ss_family, NULL, 1, 1, 0, 0);
|
||||
if (client == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
enet_address_set_host(&address, RemoteAddrString);
|
||||
enet_address_set_port(&address, 48010);
|
||||
|
||||
// Connect to the host
|
||||
peer = enet_host_connect(client, &address, 1, 0);
|
||||
if (peer == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user