mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-02-02 21:04:45 +01:00
Fixed broken code on linux
This commit is contained in:
parent
7f4557527e
commit
3350697875
@ -68,7 +68,7 @@ namespace net {
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (_udp) {
|
if (_udp) {
|
||||||
int fromLen = sizeof(remoteAddr);
|
socklen_t fromLen = sizeof(remoteAddr);
|
||||||
ret = recvfrom(_sock, (char*)buf, count, 0, (struct sockaddr*)&remoteAddr, &fromLen);
|
ret = recvfrom(_sock, (char*)buf, count, 0, (struct sockaddr*)&remoteAddr, &fromLen);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -212,7 +212,11 @@ namespace net {
|
|||||||
|
|
||||||
// Accept socket
|
// Accept socket
|
||||||
_sock = ::accept(sock, NULL, NULL);
|
_sock = ::accept(sock, NULL, NULL);
|
||||||
|
#ifdef _WIN32
|
||||||
if (_sock < 0 || _sock == SOCKET_ERROR) {
|
if (_sock < 0 || _sock == SOCKET_ERROR) {
|
||||||
|
#else
|
||||||
|
if (_sock < 0) {
|
||||||
|
#endif
|
||||||
listening = false;
|
listening = false;
|
||||||
throw std::runtime_error("Could not bind socket");
|
throw std::runtime_error("Could not bind socket");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -451,7 +455,6 @@ namespace net {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Conn(new ConnClass(sock, raddr, true));
|
return Conn(new ConnClass(sock, raddr, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user