0

I would like to have a generic on_connection callback that works with any type of server stream (pipe or tcp), but to accept the connection, you should provide an initialized client...

However uv_stream_t is an abstract struct.

Is there an official way to do that ? Else, can I do a switch relying on the private and undocumented uv_hundle_t.type member ?

Or should I use my own way of knowing the type using the .data pointer ?

hl037_
  • 3,520
  • 1
  • 27
  • 58

1 Answers1

2

You can use uv_handle_t.type, it's not "private". I just realized we haven't documented it, so I created an issue.

saghul
  • 1,990
  • 1
  • 13
  • 15