when to call ngx_handle_write_event?i am not really understanded.

Vladimir Shebordaev vshebordaev at mail.ru
Tue Jun 5 11:15:04 UTC 2012


2012/6/5 l.jay Yuan <pass86 at gmail.com>:
>    rc = WSASend(c->fd, &wsabuf, 1, (DWORD *) &n, 0, ovlp, NULL);
>

You'd better use platform-independent connection inteface here, i.e
ngx_send().

ngx_handle_write_event() is also platform-independent and is expected
to be invoked right after you've done with the current  write event
processing in your module and are about to await for the next one.

>    err = ngx_socket_errno;
>
>    if (rc == 0) {
>        if (ovlp != NULL) {
>            wev->ovlp.posted_zero_byte = 1;
>            wev->ready = 0;
>            return NGX_AGAIN;
>        }
>
> #if 0 // is test code?
>        if ((size_t) n < size) {
>            wev->ready = 0;
>        }
> #endif
>
> 2012/6/5 l.jay Yuan <pass86 at gmail.com>:
>> when to call ngx_handle_write_event?i am not really understanded.
>> who can explain me?
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>



More information about the nginx-devel mailing list