mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-18 06:10:06 +00:00
Finished video depacketizing. Starting tests
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
#include "PlatformSockets.h"
|
||||
|
||||
SOCKET bindUdpSocket(unsigned short port) {
|
||||
SOCKET s;
|
||||
struct sockaddr_in addr;
|
||||
|
||||
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (s == INVALID_SOCKET) {
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(port);
|
||||
if (bind(s, (struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR) {
|
||||
closesocket(s);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
SOCKET connectTcpSocket(IP_ADDRESS dstaddr, unsigned short port) {
|
||||
SOCKET s;
|
||||
struct sockaddr_in addr;
|
||||
|
||||
Reference in New Issue
Block a user