diff --git a/src/cudpmsgsocket.cpp b/src/cudpmsgsocket.cpp index daadd17..45d438d 100644 --- a/src/cudpmsgsocket.cpp +++ b/src/cudpmsgsocket.cpp @@ -26,6 +26,20 @@ #include #include "cudpmsgsocket.h" +//////////////////////////////////////////////////////////////////////////////////////// +// open +bool CUdpMsgSocket::Open(uint16 uiPort) +{ + bool ret; + int on = 1; + + ret = CUdpSocket::Open(uiPort); + setsockopt(m_Socket, IPPROTO_IP, IP_PKTINFO, (char *)&on, sizeof(on)); + + return ret; +} + + //////////////////////////////////////////////////////////////////////////////////////// // read diff --git a/src/cudpmsgsocket.h b/src/cudpmsgsocket.h index 657ed21..f4245c1 100644 --- a/src/cudpmsgsocket.h +++ b/src/cudpmsgsocket.h @@ -39,6 +39,9 @@ class CUdpMsgSocket : public CUdpSocket { public: + // open + bool Open(uint16); + // read int Receive(CBuffer *, CIp *, int);