From mboxrd@z Thu Jan 1 00:00:00 1970 From: bernd@petrovitsch.priv.at (Bernd Petrovitsch) Date: Tue, 18 Oct 2011 11:20:12 +0200 Subject: Problem with a UDP server implements In-Reply-To: References: <201110150151405785431@gmail.com> <1318679904.20227.1.camel@thorin> Message-ID: <1318929612.20227.15.camel@thorin> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Die, 2011-10-18 at 07:26 +0800, tao jiang wrote: [....] > Is it to create a SOCK_RAW socket for receieve and send? Only for sending. Search for sourcecode for `ping` - there are several around that show how to do it. You can use recvfrom() to get the senders address for each packet. [...] > Will it cause performance problem, compare to SOCK_DGRAM? IMHO that won't measurably - either user-space constructs the UDP and IP header or the kernel does. And we talk about a few bytes only. [ Don't top-post. ] Bernd -- Bernd Petrovitsch Email : bernd at petrovitsch.priv.at LUGA : http://www.luga.at