Closed cmachacacordova closed 3 years ago
🤔 Can I ask you what would be the purpose of this? I mean, why do you want to extend the tcp handle?
It is to create classes like Server or Client. It's an idea. With libuv I created my classes extending from uv_tcp_t and thus start the class together with the necessary handle
I'd rather suggest to use a data member for that. There is nothing wrong in removing the final
, though conceptually a server uses a handle while it is not a handle.
As I prefer composition over inheritance in this kind of situation, I like the final keyword on every handle.
Il giorno dom 16 mag 2021 alle 11:55 Michele Caini @.***> ha scritto:
I'd rather suggest to use a data member for that. There is nothing wrong in removing the final, though conceptually a server uses a handle while it is not a handle.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/skypjack/uvw/issues/243#issuecomment-841794286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPVRMXRKOXKAP7J32IB46TTN6JB7ANCNFSM446JPGPA .
-- @fiorentinoIng https://twitter.com/fiorentinoing - @.***
Ok, I close the ticket.
Hello. First of all thanks for the library. And second, can we remove the "final" operator of the TCPHandle class and have the loop.resource () method accept the custon class of TCPHandle?
Example:
class TCPHandleExtended : public uvw::TCPHandle { }; //other code.... auto loop = uvw::Loop::getDefault(); auto tcpExtended = loop->resource<TCPHandleExtended>(); //other code....
Mi ingles no es bueno. Thanks!