From: Mikko Rasa Date: Thu, 13 Nov 2008 12:47:45 +0000 (+0000) Subject: Add WSAEventSelect to DatagramSocket X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e131f8b448a24aff7cb556748cb67c6c4496b606;p=libs%2Fnet.git Add WSAEventSelect to DatagramSocket Remove outdated get_initial_events --- diff --git a/source/datagramsocket.cpp b/source/datagramsocket.cpp index 9779bfe..7944532 100644 --- a/source/datagramsocket.cpp +++ b/source/datagramsocket.cpp @@ -14,7 +14,12 @@ namespace Net { DatagramSocket::DatagramSocket(Family f, int p): Socket(f, SOCK_DGRAM, p) -{ } +{ +#ifdef WIN32 + WSAEventSelect(handle, event, FD_READ|FD_CLOSE); +#endif + set_events(IO::P_INPUT); +} int DatagramSocket::connect(const SockAddr &addr) { @@ -86,10 +91,5 @@ unsigned DatagramSocket::recvfrom(char *buf, unsigned size, SockAddr *&addr_) return ret; } -IO::PollEvent DatagramSocket::get_initial_events() const -{ - return IO::P_INPUT; -} - } // namespace Net } // namespace Msp diff --git a/source/datagramsocket.h b/source/datagramsocket.h index b97f0a6..1134415 100644 --- a/source/datagramsocket.h +++ b/source/datagramsocket.h @@ -20,8 +20,6 @@ public: int connect(const SockAddr &); unsigned sendto(const char *, unsigned, const SockAddr &); unsigned recvfrom(char *, unsigned, SockAddr *&); -private: - IO::PollEvent get_initial_events() const; }; } // namespace Net