mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 14:04:20 +01:00
Utilities have been moved to util/, but includes had not been updated
in Windows-specific files.
Ref: dfd0707a29
26 lines
393 B
C
26 lines
393 B
C
#include "util/net.h"
|
|
|
|
#include "config.h"
|
|
#include "util/log.h"
|
|
|
|
bool
|
|
net_init(void) {
|
|
WSADATA wsa;
|
|
int res = WSAStartup(MAKEWORD(2, 2), &wsa) < 0;
|
|
if (res < 0) {
|
|
LOGC("WSAStartup failed with error %d", res);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void
|
|
net_cleanup(void) {
|
|
WSACleanup();
|
|
}
|
|
|
|
bool
|
|
net_close(socket_t socket) {
|
|
return !closesocket(socket);
|
|
}
|