Re: Use of asynchronous receive at kernel level
Re: Use of asynchronous receive at kernel level
- Subject: Re: Use of asynchronous receive at kernel level
- From: "mm w" <email@hidden>
- Date: Fri, 16 May 2008 09:28:37 -0700
typedef void (*sock_upcall)(
socket_t so,
void*cookie,
int waitf);
1- when
"socket_accept()"
2 - how
http://developer.apple.com/documentation/Darwin/Conceptual/NKEConceptual/SocketManipulation/chapter_3_section_3.html
Cheers!
On Fri, May 16, 2008 at 7:31 AM, Rick Macklem <email@hidden> wrote:
>
>
> On Thu, 15 May 2008, Eddy Quicksall wrote:
>
>>
>> But there is only one upcall function per socket and there does not seem
>> to
>> be any way to tell what the upcall is for. Is there something I'm missing?
>>
> The upcall was added to 4.3BSD back in the late 80s (I had more hair then,
> but never wore disco boots:-). It was specifically for the nfs server. The
> upcall is called whenever data is added to the receive queue for the TCP
> socket. If you want to read data off the socket, you have to do a
> soreceive() etc. Take a look at the nfs server sources in xnu-1228 to see
> how the nfsd uses it. (xnu-1228/bsd/nfs/nfs_socket.c)
>
> I'm not sure about xnu-1228, but in the bad old days the upcall function
> couldn't tsleep(), so it basically would try and build up an RPC request
> without blocking. If it had to block or once all of an RPC request was
> received, it would wake up an nfsd thread to do the work.
>
> And, yes, you can only have one upcall function associated with a TCP
> socket, so you'll have to do whatever you want to do in that function, or
> wake up other threads in the kernel to do the work.
>
> Good luck with it, rick
>
> _______________________________________________
> 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
>
--
-mmw
_______________________________________________
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