SpiecsEngine
 
Loading...
Searching...
No Matches

◆ WakeUp()

void Spices::Net::EventLoop::WakeUp ( )

WakeUp a thread, which wait on recv, by sending one byte data.

Definition at line 104 of file EventLoop.cpp.

105 {
106 char one = 1;
107 int n = ::send(m_WakeupFd.Fd(), &one, sizeof(one), 0);
108 if (n < 0)
109 {
110 std::stringstream ss;
111 ss << "EventLoop::WakeUp error, Error: " << WSAGetLastError();
112
113 SPICES_CORE_ERROR(ss.str())
114 }
115 }
Socket m_WakeupFd
Wakeup Socket.
Definition EventLoop.h:153
const SOCKET Fd() const
Get this socket fd.
Definition Socket.h:60

Referenced by QueueInLoop(), and Quit().