Added asynchronous udp receive function (#193)

* Added asynchronous udp receive function

* Remove receive_async and added low level recv, which is non-blocking.

* Remove thread include

* Moved unix include to IXNetSystem.h
This commit is contained in:
tostc
2020-05-05 16:47:41 +02:00
committed by GitHub
parent 15355188d5
commit 7337ed34a6
3 changed files with 31 additions and 1 deletions

View File

@ -18,7 +18,7 @@ typedef SSIZE_T ssize_t;
#include "IXNetSystem.h"
namespace ix
{
{
class UdpSocket
{
public:
@ -28,9 +28,12 @@ namespace ix
// Virtual methods
bool init(const std::string& host, int port, std::string& errMsg);
ssize_t sendto(const std::string& buffer);
ssize_t recvfrom(void* buffer, size_t length);
void close();
static int getErrno();
static bool isWaitNeeded();
static void closeSocket(int fd);
private: