Manual disconnect on deallocation and do not clear message handler or message received
Summary: Trigger a manual disconnect on deallocation. This was done automatically for us when the underlying socket gets released. But, this gives a bit more visibility and control onto exactly when this is going to take place. Additionally, do not clear the message handler when a message is received. It is not required as sendExpectResponse is one time called only used for certificate exchange. If this takes place again, a new handler will be set anyway. Reviewed By: passy Differential Revision: D31231828 fbshipit-source-id: 36ad13564a358b88d1618e94195fe05433d80993
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ef6e802244
commit
cf1d579462
@@ -28,15 +28,13 @@ class FlipperWebSocket : public FlipperSocket {
|
||||
public:
|
||||
FlipperWebSocket(
|
||||
FlipperConnectionEndpoint endpoint,
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload,
|
||||
folly::EventBase* eventBase);
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload);
|
||||
FlipperWebSocket(
|
||||
FlipperConnectionEndpoint endpoint,
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload,
|
||||
folly::EventBase* eventBase,
|
||||
ConnectionContextStore* connectionContextStore);
|
||||
|
||||
virtual ~FlipperWebSocket() {}
|
||||
virtual ~FlipperWebSocket();
|
||||
|
||||
virtual void setEventHandler(SocketEventHandler eventHandler) override;
|
||||
virtual void setMessageHandler(SocketMessageHandler messageHandler) override;
|
||||
@@ -55,13 +53,12 @@ class FlipperWebSocket : public FlipperSocket {
|
||||
private:
|
||||
FlipperConnectionEndpoint endpoint_;
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload_;
|
||||
folly::EventBase* eventBase_;
|
||||
ConnectionContextStore* connectionContextStore_;
|
||||
|
||||
FlipperPlatformWebSocket* socket_;
|
||||
|
||||
SocketEventHandler eventHandler_;
|
||||
SocketMessageHandler messageHandler_;
|
||||
|
||||
FlipperPlatformWebSocket* socket_;
|
||||
};
|
||||
|
||||
class FlipperWebSocketProvider : public FlipperSocketProvider {
|
||||
@@ -72,7 +69,7 @@ class FlipperWebSocketProvider : public FlipperSocketProvider {
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload,
|
||||
folly::EventBase* eventBase) override {
|
||||
return std::make_unique<FlipperWebSocket>(
|
||||
std::move(endpoint), std::move(payload), eventBase);
|
||||
std::move(endpoint), std::move(payload));
|
||||
}
|
||||
virtual std::unique_ptr<FlipperSocket> create(
|
||||
FlipperConnectionEndpoint endpoint,
|
||||
@@ -80,10 +77,7 @@ class FlipperWebSocketProvider : public FlipperSocketProvider {
|
||||
folly::EventBase* eventBase,
|
||||
ConnectionContextStore* connectionContextStore) override {
|
||||
return std::make_unique<FlipperWebSocket>(
|
||||
std::move(endpoint),
|
||||
std::move(payload),
|
||||
eventBase,
|
||||
connectionContextStore);
|
||||
std::move(endpoint), std::move(payload), connectionContextStore);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user