Thread overview |
---|
March 24, 2015 How to connect asynchronously (non block) with kqueue? | ||||
---|---|---|---|---|
| ||||
I am using kqueue on macosx, I know how to write a simple server. But don't know which event will be triggered in kqueue when connected successfully , which event when failed? EVFILT_READ or EVFILT_WRITE? I have googled this question, got no examples, any suggestions are welcome, Thanks. |
March 24, 2015 Re: How to connect asynchronously (non block) with kqueue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to zhmt | On 3/24/2015 5:50 AM, zhmt wrote: > I am using kqueue on macosx, I know how to write a simple server. But > don't know which event will be triggered in kqueue when connected > successfully , which event when failed? > > EVFILT_READ or EVFILT_WRITE? > > I have googled this question, got no examples, any suggestions are > welcome, Thanks. Look into libasync for an abstraction to kqueue https://github.com/etcimon/libasync Also, this is what you're looking for: https://github.com/etcimon/libasync/blob/628850e8a6020298612e8a35229f5539d7385bae/source/libasync/posix.d#L1826 |
March 24, 2015 Re: How to connect asynchronously (non block) with kqueue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne | On Tuesday, 24 March 2015 at 12:25:14 UTC, Etienne wrote:
> On 3/24/2015 5:50 AM, zhmt wrote:
>> I am using kqueue on macosx, I know how to write a simple server. But
>> don't know which event will be triggered in kqueue when connected
>> successfully , which event when failed?
>>
>> EVFILT_READ or EVFILT_WRITE?
>>
>> I have googled this question, got no examples, any suggestions are
>> welcome, Thanks.
>
> Look into libasync for an abstraction to kqueue
>
> https://github.com/etcimon/libasync
>
> Also, this is what you're looking for:
>
> https://github.com/etcimon/libasync/blob/628850e8a6020298612e8a35229f5539d7385bae/source/libasync/posix.d#L1826
This is exacatly what I am looking for, very good! Thanks!
|
Copyright © 1999-2021 by the D Language Foundation