Jump to content
  • Advertisement
Sign in to follow this  
BigBeginner

Winsock packet sniffing in the bacground/callback

This topic is 4333 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a little program that receive the packets now, the only problem it can only examin then in a cycle. Its no good: repeat BYTES = recvfrom(sniffer,Buffer^,65536,0,0,0); //Eat as much as u can ProcessPacket(Buffer, BYTES); until ENDSIGNAL its a windowed application. When this repeat-until running, my app doesn't appears. How to set up the winsock to get the packets with a callback routine?

Share this post


Link to post
Share on other sites
Advertisement
The Forum FAQ points to some tutorials you can try. I would recommend against using WSAAsyncSelect(), and instead recommend setting a window timer, and using select() to see which sockets are readable inside that poll.

Another option is using something like MsgWaitForMultipleObjects() with the socket as one object, if compatibility with DOS-based Windows isn't necessary.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!