All of lore.kernel.org
 help / color / mirror / Atom feed
From: bernd@petrovitsch.priv.at (Bernd Petrovitsch)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Problem with a UDP server implements
Date: Tue, 18 Oct 2011 11:20:12 +0200	[thread overview]
Message-ID: <1318929612.20227.15.camel@thorin> (raw)
In-Reply-To: <CAOe6JY0ML9o5g=o9sYTD6cQg0DoXR06hns33=S1M8EMmyH5qgA@mail.gmail.com>

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

  reply	other threads:[~2011-10-18  9:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 17:51 Problem with a UDP server implements jiangtao.jit
2011-10-15  6:04 ` michi1 at michaelblizek.twilightparadox.com
2011-10-15  8:29   ` tao jiang
2011-10-15  9:01     ` michi1 at michaelblizek.twilightparadox.com
2011-10-15  9:50       ` tao jiang
2011-10-15 11:58 ` Bernd Petrovitsch
2011-10-17 23:26   ` tao jiang
2011-10-18  9:20     ` Bernd Petrovitsch [this message]
2011-10-18 14:48       ` tao jiang
2011-10-19  7:28         ` Bernd Petrovitsch
2011-10-21 13:07           ` tao jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318929612.20227.15.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.