stopping connection on Linux does not close the socket, which can create problem when re-starting the connection

This commit is contained in:
Benjamin Sergeant
2018-11-01 17:02:49 -07:00
parent 9c81eeace0
commit cf0045a483
5 changed files with 26 additions and 59 deletions

View File

@ -11,6 +11,8 @@
#include <mutex>
#include <atomic>
#include "IXEventFd.h"
struct addrinfo;
namespace ix
@ -45,14 +47,11 @@ namespace ix
static void cleanup(); // Required on Windows to cleanup WinSocket
protected:
void wakeUpFromPollApple();
void wakeUpFromPollLinux();
void closeSocket(int fd);
std::atomic<int> _sockfd;
int _eventfd;
std::mutex _socketMutex;
EventFd _eventfd;
private:
bool connectToAddress(const struct addrinfo *address,