On 07/09/2015 10:54 PM, Hussein Daneshvar wrote:
> Hi
> 1.Initialization
> 
>   * Setting "http_parser_setting"
>   * Init TCP for listening Port 80
>   * Call uv_run
> 
> 2.On "uv_connection_cb"
> 
>   * Call uv_tcp_init for Client handle
>   * Call uv_accept
>   * Call http_parser_init
>   * Call uv_read_start
> 
> 3.On "uv_read_cb"
> 
>   * Call http_parser_execute
> 
> 4.On HTTP Parser "on_message_complete"
> 
>   * Call uv_queue_work
> 
> 5.On uv_work_cb
> 
>   * Call uv_write HTTP Header with "Transfer-Encoding: chunked" field
>     and Data Part 1
>   * Call uv_write for Data Part 2
>   * Call uv_write for Data Part 3
>   * Call uv_write for Data Part 4
> 
> 6.On uv_after_work_cb
> 
>   * Call uv_close for Client handle
> 
> is this cycle right ?

No. You shouldn't be using uv_queue_work, as it runs the given code in t
athread from the threadpool, and uv_write (or any other handle function
except uv_async_send, for that matter) is not thread-safe.


Regards,

-- 
Saúl Ibarra Corretgé
bettercallsaghul.com


-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to