Re: Asynchronous sock_sendmbuf
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi Igor, -josh Hello! I'm using non-blocking sockets. I couldn't find a way to get to know the result of send operation. If I understand correctly upcall callback is called only when an incoming data is available (I do not talk here about listen / accept). So is there any way to get to know if my send operation is completed? What is EWOULDBLOCK status for in sock_sendmbuf? What does it mean? Thanks. Best Regards. Igor _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/jgraessley%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... When using sockets in the kernel or in user space, there is no way to know, without polling, when the data has been sent. The send/sendmbuf calls enqueue data in the socket buffer. In the case of a UDP socket, the data goes right out. In the case of a TCP socket, the data stays enqueued until it is acknowledged by the remote side. Whether you're using blocking or non-blocking calls, the call is "done" as soon as the data has been copied in to the send buffer for a TCP socket. Notification from the upcall when there is more room in the send buffer would be good but does not currently exist. This is a know problem and it is being tracked by: <rdar://problem/4833986> KPI socket upcall should notify on multiple events This still doesn't address the problem that the upcall itself does not provide any information about what sort of event occurred. The socket API in user space is pretty limited in the event notification it can provide. The upcall is even worse because you can't distinguish between read and write ready. This problem is being tracked by: <rdar://problem/5534287> Upcalls could be better On May 20, 2008, at 12:55 AM, Igor Mikushkin wrote: This email sent to jgraessley@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Josh Graessley