Re: wanted: sosend() howto
Re: wanted: sosend() howto
- Subject: Re: wanted: sosend() howto
- From: Stefan Werner <email@hidden>
- Date: Fri, 19 Sep 2003 12:19:17 +0200
Hi,
On Friday, Sep 19, 2003, at 07:00 Europe/Berlin,
email@hidden wrote:
Date: Thu, 18 Sep 2003 23:05:28 +0100
To: email@hidden
From: Quinn <email@hidden>
Subject: Re: wanted: sosend() howto
In general Apple recommends that you avoid doing networking from
kernel code because it requires you to use BSD in-kernel 'APIs', and
there's no promise of binary compatibility for those APIs. A better
solution is to use a user space daemon to do the networking on behalf
of your kernel extension. This is, for example, what our WebDAV VFS
plug-in does.
If you can explain a little more about the big picture of your kernel
extension, I might be able to suggest an alternative design that will
make the networking simpler.
I am working on an OS X based audio over Ethernet solution. Typically,
audio drivers in OS X are kernel extensions (there is a way of doing it
in user space like the iSight driver, but after evaluating it I came to
the conclusion that the kernel driver API suits my needs better), and I
am using the NetworkAudioDevice driver from opendarwin.org as a
reference. This driver is using sosend() for transmitting TCP packets,
and I now have it working with UDP packets (thanks to help from this
list :). A user space daemon would be an option (cause I don't like
working in kernel space, debugging is a lot harder than in user space),
as long as I get the same precise timing as I do with the kernel
driver. I'm confident that the context switches won't be a problem,
being in the range of nanoseconds, but I need the guarantee that my
network packet is being transmitted as soon as possible and not being
delayed because the scheduler put my daemon to sleep.
If there is sample code and maybe some documentation on how to
establish efficient kernel/user space communication and an data
transfer, I'd be grateful for any links.
Stefan
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.