recvfrom函数使用MSG_PEEK参数,导致2次FD_READ事件?解决方法

recvfrom函数使用MSG_PEEK参数,导致2次FD_READ事件?
例子:
C/C++ code
int ret 
        =recvfrom(s,BUFF,LEN,MSG_PEEK,(SOCKADDR*)&addr,&addrLen);//这里会触发一个FD_READ事件

     ret =recvfrom(s,BUFF,LEN,0,(SOCKADDR*)&addr,&addrLen);


导致2次读取数据 
 请问如何判断或者进行处理?


------解决方案--------------------
FD_READ应该不是你来触发的,是当套节字可读的时候触发的。触发时你调用两次 recvfrom也没问题,不会触发FD_READ的
------解决方案--------------------
FD_READ是自动触发
你不需要自行处理
------解决方案--------------------
MSG_PEEK Peeks at the incoming data. The data is copied into the buffer but is not removed from the input queue. The function subsequently returns the amount of data that can be read in a single call to the recvfrom (or recv) function, which may not be the same as the total amount of data queued on the socket. The amount of data that can actually be read in a single call to the recvfrom (or recv) function is limited to the data size written in the send or sendto function call.