Various fixes and improvements, backported from Pro version. Code by Erik Zandvliet.
This commit is contained in:
parent
5cce37c521
commit
b28a619fc6
13 changed files with 383 additions and 550 deletions
|
@ -1167,6 +1167,13 @@ int Socket::UDPConnection::bind(int port) {
|
|||
/// \return True if a packet was received, false otherwise.
|
||||
bool Socket::UDPConnection::Receive() {
|
||||
int r = recvfrom(sock, data, data_size, MSG_PEEK | MSG_TRUNC, 0, 0);
|
||||
if (r == -1){
|
||||
if (errno != EAGAIN){
|
||||
INFO_MSG("Found an error: %d (%s)", errno, strerror(errno));
|
||||
}
|
||||
data_len = 0;
|
||||
return false;
|
||||
}
|
||||
if (data_size < (unsigned int)r) {
|
||||
data = (char *)realloc(data, r);
|
||||
if (data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue