oatpp / oatpp-websocket

oatpp-websocket submodule.
https://oatpp.io/
Apache License 2.0
78 stars 32 forks source link

Multiple calls to onBeforeDestroy #3

Closed c-lgrant closed 5 years ago

c-lgrant commented 5 years ago

Hey,

I have noticed that for the websocket connections. i see that onBeforeDestroy is called twice is this expected?

        void onBeforeDestroy(const oatpp::websocket::WebSocket& socket) override {
            OATPP_LOGD(TAG, "Closing connection");
        }

produces

MySocketInstanceListener Closing connection
MySocketInstanceListener Closing connection

Is this expected

Thanks

Conor

lganzzzo commented 5 years ago

Hey @c-lgrant

Please see fix for this issue!

Best Regards, Leonid

c-lgrant commented 5 years ago

Hey,

Perfect that works as expected.

Thank you for your quick response !

Regards

c-lgrant commented 5 years ago

@lganzzzo

Is there a way to get the remote ip address of the socket?

i want to try to log every new socket connection

Thanks

Conor

lganzzzo commented 5 years ago

@c-lgrant

Is there a way to get the remote ip address of the socket? i want to try to log every new socket connection

Currently it is not possible.

I plan to add possibility to bind bundle of optional properties to output::data::IOStream sometime in future.

I think I'll get to it in something like a month from now.

Regards, Leonid