Re: Supporting non-blocking sends in a socket filter NKE
Re: Supporting non-blocking sends in a socket filter NKE
- Subject: Re: Supporting non-blocking sends in a socket filter NKE
- From: Bogdan Harjoc <email@hidden>
- Date: Wed, 7 Jul 2010 18:02:25 +0300
Not an authoritative answer, but:
Anything else except zero and EJUSTRETURN that you return in
sf_data_in_func gets interpreted as "drop the data" from what I
understand. Userspace won't receive the error.
If the KPI allowed this, you could manipulate the sb_hiwat field in
the "struct socket" when your NKE is busy, which would make the window
shrink to zero, which is possibly what you want. But there is no such
KPI (yet).
See [1] for a clean way to do this. But you need a userspace daemon
and additional loopback connections will show up in netstat.
Hope this helps,
Bogdan
[1] http://lists.apple.com/archives/darwin-kernel/2007/Mar/msg00081.html
On Mon, Jul 5, 2010 at 9:30 PM, Ryan Weedon <email@hidden> wrote:
> I have an NKE that uses a socket filter to intercept TCP data sent by
> applications.
>
> I am trying to figure out how to deal with the case where an application
> sets a socket to be non-blocking, and then sends data faster than the NKE
> can handle it. The filter can just return EAGAIN/EWOULDBLOCK at this point,
> but I don’t know how to signal at some point later the socket is again
> available for writing. Is this possible?
>
>
>
> Regards,
>
> Ryan Weedon
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden