Save the connection after it's established so we can actually send messages to it.

This commit is contained in:
casey langen 2022-03-25 23:55:47 -07:00
parent ca0023eef6
commit 48ee1419b5
2 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ PiggyWebSocketClient::PiggyWebSocketClient(IMessageQueue* messageQueue)
rawClient->SetMode(RawWebSocketClient::Mode::PlainText);
rawClient->SetOpenHandler([this](Connection connection) {
this->connection = connection;
this->SetState(State::Connected);
});

View File

@ -117,7 +117,7 @@ int main(int argc, char* argv[]) {
freopen(errorFn.c_str(), "w", stderr);
auto piggyClient = std::make_shared<PiggyWebSocketClient>(&Window::MessageQueue());
piggyClient->Connect("192.168.1.27");
piggyClient->Connect("localhost");
auto piggyLogger = new PiggyDebugBackend(piggyClient);
auto fileLogger = new debug::SimpleFileBackend();