On Sun, Jan 29, 2017 at 1:16 PM, Dávid Szakállas
<[email protected]> wrote:
> I posted a Q&A on StackOverflow on how to get the accepted socket handle for
> a client. However I got an immediate downvote on supposed 'bad style', as I
> cast the things mentioned in the title. I am not claiming I am good with C,
> however I saw this pattern in all libuv tutorials, and I fail to see how
> else I can do it.

Yes, you will need to cast in places.  uv_tcp_t "inherits" from
uv_stream_t, which in turn inherits from uv_handle_t.  Scare quotes
because C doesn't have a concept of inheritance, but it's similar to
upcasting a struct sockaddr_in pointer to struct sockaddr in calls to
bind().

-- 
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 https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to