mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Don't bind to a specific port anymore
This commit is contained in:
parent
36b426d59e
commit
841e3d9f22
@ -196,7 +196,7 @@ int startAudioStream(void) {
|
|||||||
|
|
||||||
callbacks.init();
|
callbacks.init();
|
||||||
|
|
||||||
rtpSocket = bindUdpSocket(RTP_PORT);
|
rtpSocket = bindUdpSocket();
|
||||||
if (rtpSocket == INVALID_SOCKET) {
|
if (rtpSocket == INVALID_SOCKET) {
|
||||||
return LastSocketError();
|
return LastSocketError();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "PlatformSockets.h"
|
#include "PlatformSockets.h"
|
||||||
#include "Limelight-internal.h"
|
#include "Limelight-internal.h"
|
||||||
|
|
||||||
SOCKET bindUdpSocket(unsigned short port) {
|
SOCKET bindUdpSocket(void) {
|
||||||
SOCKET s;
|
SOCKET s;
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
int val;
|
int val;
|
||||||
@ -14,7 +14,6 @@ SOCKET bindUdpSocket(unsigned short port) {
|
|||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(port);
|
|
||||||
if (bind(s, (struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR) {
|
if (bind(s, (struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR) {
|
||||||
err = LastSocketError();
|
err = LastSocketError();
|
||||||
closesocket(s);
|
closesocket(s);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SOCKET connectTcpSocket(IP_ADDRESS dstaddr, unsigned short port);
|
SOCKET connectTcpSocket(IP_ADDRESS dstaddr, unsigned short port);
|
||||||
SOCKET bindUdpSocket(unsigned short port);
|
SOCKET bindUdpSocket(void);
|
||||||
int enableNoDelay(SOCKET s);
|
int enableNoDelay(SOCKET s);
|
||||||
int initializePlatformSockets(void);
|
int initializePlatformSockets(void);
|
||||||
void cleanupPlatformSockets(void);
|
void cleanupPlatformSockets(void);
|
@ -162,7 +162,7 @@ int startVideoStream(void* rendererContext, int drFlags) {
|
|||||||
callbacks.setup(configuration.width,
|
callbacks.setup(configuration.width,
|
||||||
configuration.height, 60, rendererContext, drFlags);
|
configuration.height, 60, rendererContext, drFlags);
|
||||||
|
|
||||||
rtpSocket = bindUdpSocket(RTP_PORT);
|
rtpSocket = bindUdpSocket();
|
||||||
if (rtpSocket == INVALID_SOCKET) {
|
if (rtpSocket == INVALID_SOCKET) {
|
||||||
return LastSocketError();
|
return LastSocketError();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user