Click here to Skip to main content
12,824,787 members (38,530 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows udp Sockets
Hey code-project,
I am wanting to ask this question, for quite sometime anyway the question: How can i create an Raw socket which sends an lot of UDP packets in c++ under Windows? If so please show me an code of how to do it or an tutorial.
In advance,
Posted 29-Sep-12 9:01am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Maybe good enough to get an idea, a 5.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

As far as I know right we had full raw socket support in windows beginning with win2000 and ending with WinXP SP1. From WinXP SP2 only raw UDP sockets are available and even raw UDP sockets have some extra restrictions. More about these limitations here:[^].

You can use the winpcap driver to have better raw socket support, even with TCP:[^].
I'm not going to write a novel about winpcap here, check out its documentation. If you need total freedom on windows use this. Another benefit of winpcap is that its compatible with libpcap (its unix sibling) on source level so you can write platform independent network tools using it. Winpcap is utilized by my favorite packet sniffer: WireShark.

Now you have the essential info and the keywords to search for code examples using google. For example using the "winpcap raw udp packet tutorial" keywords with google I found this: How to craft UDP packets and send them with WinPCap[^]
Espen Harlinn 1-Oct-12 18:23pm
pasztorpisti 1-Oct-12 18:24pm
Thank you!
My 5.
However, I usually answer "I don't known". How do we know what OP can do? Except some things which nobody can. :-)
pasztorpisti 5-Nov-12 17:26pm
Thanks! He might be a genius just testing our knowledge, who knows... :-)
Exactly. Even a genius deserves some chance... :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 29 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100