Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could it run on iOS or android ? #9

Closed
NeoChow opened this issue Oct 11, 2018 · 67 comments

Comments

@NeoChow
Copy link

commented Oct 11, 2018

Since both of them support the clang compiler.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented Oct 12, 2018

Hello @NeoChow ,
Good question. I did not try to build oatpp for android, and/or iOS.

If you have possibility to try it would be perfect. I'll provide an assistance in case of any questions.
If you have no possibility, I'll try to do it some time later

@NeoChow

This comment has been minimized.

Copy link
Author

commented Oct 12, 2018

@lganzzzo I'll give you a feedback as soon as I've tested it. : )

@lganzzzo lganzzzo added the question label Feb 23, 2019

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo Hello Leonid! I am trying out oatpp and oatpp-websocket on Android (and soon iOS) because I need to use Websockets on mobile devices. I have almost gotten it to compile. I have one compiler error that I have not figured out yet. The following error is on line 47 in Thread::setThreadAffinityToCpuRange:

"use of undeclared identifier 'pthread_setaffinity_np'; did you mean 'sched_setaffinity'"

I am using the commits at tag 0.19.1 for both oatpp and oatpp-websocket.

If I change pthread_setaffinity_np to sched_setaffinity in my local copy of Thread.cpp it compiles (and links) successfully.

Do you know why my compiler cannot find pthread_setaffinity_np? Would it be an acceptable workaround to use sched_setaffinity instead?

@NeoChow were you able to build oatpp for Android or iOS?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

Hello @dmcamens-legrand ,
Thank you for your interest!

"use of undeclared identifier 'pthread_setaffinity_np'; did you mean 'sched_setaffinity'"
Do you know why my compiler cannot find pthread_setaffinity_np? Would it be an acceptable workaround to use sched_setaffinity instead?

As I understand from https://stackoverflow.com/questions/30801752/android-ndk-and-pthread
pthread is limited on Android. So I guess pthread_setaffinity_np is not available on Android.

As workaround you may just comment it out. Or try to replace it for Android with #ifdefs

I am using the commits at tag 0.19.1 for both oatpp and oatpp-websocket.

Please use 0.19.4 for both. It is much more stable and has a lot of memory-leaks, and crushes fixed.

P.S. Please let me know in case of any questions.

Best Regards,
Leonid

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@dmcamens-legrand
please let me know if you have any problems updating from 0.19.1 to 0.19.4

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo Thanks for your fast response and the hints! I wanted to use 0.19.4 but I could not find a 0.19.4 tag in the oatpp-websocket repo which is why I used 0.19.1 for both. Which oatpp-websocket commit ID should I use?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo Thank you! I will update to 0.19.4 for both. Do you want me to create a PR with the Android workaround?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@dmcamens-legrand Yes sure, it will be cool!

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo Ok I will do that, thanks. One more question. Do you have any example code or documentation that describes how to use the WebSocket classes? I checked on the website and I didn't see any examples for WebSockets.

Update: I found the test directory alongside the source code. I will start there!

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

Or maybe you just have some quick hints like which class to use?

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo I tried to push my branch but it said I don't have permission. Do you need to add me as a contributor?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@dmcamens-legrand

Do you have any example code or documentation that describes how to use the WebSocket classes?

https://github.com/lganzzzo/oatpp-example-websocket - this is a simple echo WebSocket server example. This is a "simple" multithreaded websocket server.

You may try to use http://www.websocket.org/echo.html to test this server.
Put ws://localhost:8000/websocket-connect in location field

I tried to push my branch but it said I don't have permission. Do you need to add me as a contributor?

Please fork repo, and create a PR as for "Github flow".

Please let me know if you have any questions.

Regards,
Leonid

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

Also,

Please don't hesitate asking whatever question you have. - It will help me improve documentation.

Also any feedbacks are valuable.

Thanks for your interest in the project,
Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo Thank you for your help. I will fork the repo and create a PR that way. Also, I need to use the websocket as a client, not as a server. Do you know of any client-side examples?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@dmcamens-legrand

Please see simple client example below:

#include "oatpp-websocket/Connector.hpp"
#include "oatpp/network/client/SimpleTCPConnectionProvider.hpp"


/**
 * WebSocket listener
 */
class ClientWebSocketListener : public oatpp::websocket::WebSocket::Listener {
private:
  static constexpr const char *const TAG = "ClientWebSocketListener";
private:
  oatpp::data::stream::ChunkedBuffer m_messageBuffer;
public:

  void onPing(const WebSocket &socket, const oatpp::String &message) override {
    OATPP_LOGD(TAG, "Ping frame received. Sending Pong back.");
    socket.sendPong(message);
  }

  void onPong(const WebSocket &socket, const oatpp::String &message) override {
    OATPP_LOGD(TAG, "Pong frame received. Do nothing.");
    // DO NOTHING
  }

  void onClose(const WebSocket &socket, v_word16 code, const oatpp::String &message) override {
    OATPP_LOGD(TAG, "Close frame received. Code=%hd, Message='%s'", code, message->c_str());
  }

  /**
   * Called when "text" or "binary" frame received.
   * When all data of message is read, readMessage is called again with size == 0 to
   * indicate end of the message
   */
  void readMessage(const WebSocket &socket, p_char8 data, oatpp::data::v_io_size size) override {
    if (size == 0) {
      auto wholeMessage = m_messageBuffer.toString();
      OATPP_LOGD(TAG, "Message Received! '%s'", wholeMessage->c_str());
      m_messageBuffer.clear();
    } else if (size > 0) {
      m_messageBuffer.write(data, size);
    }
  };

};

void run() {
    
    /* Create Client ConnectionProvider  */
    /* Note: In order to connect via SSL use secure ConnectionProvider from oatpp-libressl */
    auto connectionProvider = oatpp::network::client::SimpleTCPConnectionProvider::createShared("echo.websocket.org", 80);
    
    /* Create WebSocker Connector */
    auto connector = oatpp::websocket::Connector::createShared(connectionProvider);

    /* Connect on endpoint, make handshakes and return connection stream */
    auto connection = connector->connect("/");

    /* Create client WebSocket to handle connection stream */
    oatpp::websocket::WebSocket socket(connection, true /* maskOutgoingMessages must be true for clients */);

    /* Set WebSocket events listener */
    socket.setListener(std::make_shared<ClientWebSocketListener>());

    /* Listen on WebSocket. Will block here until connection is closed */
    socket.listen();

}

Note: if you have call socket.send... from different threads, calls to socket.send... must be synchronized.

Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@lganzzzo I was able to get the example running in Android and it works. Thank you for that! Now I need to convert it so it works over TLS. I integrated oatpp-libressl and now I need to find the correct libressl to use. Can you point me to the proper libressl? Thanks!

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 22, 2019

Hey @dmcamens-legrand ,

In oatpp-libressl there is an utility folder. You can find install-libressl.sh there. It may help you.

There are instructions how to build and install libressl-2.9.0.

I think it should be possible to build it for android.

Also when you get libressl built for android, look at https://github.com/oatpp/example-libressl for usage details.
Pay attention to

  /* set lockingCallback for libressl */ 
  oatpp::libressl::Callbacks::setDefaultCallbacks(); // needed to use LibreSSL in multithreaded environment
  
  /* ignore SIGPIPE */
  std::signal(SIGPIPE, SIG_IGN);

Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

@lganzzzo Thanks for the hints! I looked into libressl-portable. It looks like they did some work in 2.9.1 and 2.9.2 to make it build on Android. I'm going to try that unless you have another idea.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 23, 2019

@dmcamens-legrand yes, good idea. Please let me know if it worked out.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

Will do!

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 23, 2019

If its not working, or too hard other option is to take different TLS backend (example mbedTLS, or whatever fits better for android/iOS). There is a need to implement oatpp adapter for that.

just to keep in mind.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@lganzzzo I'm still working on it...I got pulled off onto other things yesterday but I hope to get back to this later today or next Tuesday. Thanks for your help so far.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 24, 2019

@dmcamens-legrand
No worries. Just let me know if you need some help from my side.
I am currently working on https://github.com/oatpp/oatpp-mbedtls - adapter for MbedTLS. Maybe it will be a better solution for Android/iOS client's TLS. I plan to finish it by mid of next week.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@lganzzzo Ok, thanks for letting me know your schedule for MbedTLS. I will take a look and see whether it will be easier for me to use MbedTLS or libressl. Which one do you think would be easier?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Which one do you think would be easier?

Not sure. Have to try

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

I'll read up on them both and will let you know which is the better solution.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 24, 2019

@dmcamens-legrand ,
That will be great!
Thanks a lot!

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

@lganzzzo I was able to easily build mbedtls for Android. libressl was not so easy and I did not even succeed, so I am going to go down the mbedtls path. I am eagerly awaiting your adapter!

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

@lganzzzo I tested it and it was able to echo one message back to my app. That is great! The second message did not come back though. If I replace it with SimpleTCPConnectionProvider then it works again. Are there any hints to getting it to work multiple times in a row?

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

Here is my code.

` /* Create Client ConnectionProvider /
/
Note: In order to connect via SSL use secure ConnectionProvider from oatpp-libressl */
//auto connectionProvider = oatpp::network::client::SimpleTCPConnectionProvider::createShared("echo.websocket.org", 80);

        /* tls config */
        auto config = oatpp::mbedtls::Config::createDefaultClientConfigShared();

        /* Create secure ConnectionProvider */
        auto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, "echo.websocket.org", 443);


        logString = "openWebSocket: BEFORE Connector::createShared";
        Log(LOG_LEVEL_FINE, logString.c_str());

        /* Create WebSocker Connector */
        auto connector = oatpp::websocket::Connector::createShared(connectionProvider);

        logString = "openWebSocket: BEFORE Connector::connect";
        Log(LOG_LEVEL_FINE, logString.c_str());

        /* Connect on endpoint, make handshakes and return connection stream */
        auto connection = connector->connect("/");

        logString = "openWebSocket: BEFORE WebSocket::WebSocket";
        Log(LOG_LEVEL_FINE, logString.c_str());

        /* Create client WebSocket to handle connection stream */
        mWebSocket = new oatpp::websocket::WebSocket(connection, true /* maskOutgoingMessages must be true for clients */);

        logString = "openWebSocket: BEFORE WebSocket::setListener";
        Log(LOG_LEVEL_FINE, logString.c_str());

        /* Set WebSocket events listener */
        mWebSocket->setListener(std::make_shared<ClientWebSocketListener>());

        logString = "openWebSocket: BEFORE mWebSocketTask.reset";
        Log(LOG_LEVEL_FINE, logString.c_str());

        mWebSocketTask.reset(new WebSocketTask(mWebSocket));

        std::this_thread::sleep_for(std::chrono::milliseconds(1000));

        logString = "openWebSocket: BEFORE WebSocket::sendOneFrameText";
        Log(LOG_LEVEL_FINE, logString.c_str());

        oatpp::String hello = "Hello Websocket!";
        mWebSocket->sendOneFrameText(hello);

        std::this_thread::sleep_for(std::chrono::milliseconds(1000));

        mWebSocket->sendOneFrameText(hello);`
@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 28, 2019

@dmcamens-legrand Ok, give me 10mins to reproduce...

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 28, 2019

@dmcamens-legrand
Just tested. (On my laptop - not on Android)
Please see full-program code bellow.
It should work correctly.

#include "oatpp-websocket/WebSocket.hpp"
#include "oatpp-websocket/Connector.hpp"

#include "oatpp-mbedtls/client/ConnectionProvider.hpp"
#include "oatpp-mbedtls/config.hpp"

#include <thread>

namespace {

oatpp::websocket::WebSocket * socket = nullptr;

class ClientWebSocketListener : public oatpp::websocket::WebSocket::Listener {
private:
  static constexpr const char* const TAG = "MySocketListener";
private:
  oatpp::data::stream::ChunkedBuffer m_messageBuffer;
public:

  void onPing(const WebSocket& socket, const oatpp::String& message) override {
    OATPP_LOGD(TAG, "Ping frame received. Sending Pong back.");
    socket.sendPong("");
  }

  void onPong(const WebSocket& socket, const oatpp::String& message) override {
    OATPP_LOGD(TAG, "Pong frame received. Do nothing.");
    // DO NOTHING
  }

  void onClose(const WebSocket& socket, v_word16 code, const oatpp::String& message) override {
    OATPP_LOGD(TAG, "Close frame received. Code=%hd, Message='%s'", code, message->c_str());
  }

  /**
   * Called when "text" or "binary" frame received.
   * When all data of message is read, readMessage is called again with size == 0 to
   * indicate end of the message
   */
  void readMessage(const WebSocket& socket, p_char8 data, oatpp::data::v_io_size size) override {
    if(size == 0) {
      auto wholeMessage = m_messageBuffer.toString();
      OATPP_LOGD(TAG, "Message='%s'", wholeMessage->c_str());
      //socket.sendOneFrameText("Hello from oatpp! Your message was: " + wholeMessage);
      m_messageBuffer.clear();
    } else if(size > 0) {
      m_messageBuffer.write(data, size);
    }
  };

};

void socketTask() {
  socket->listen();
}

void run() {

  auto config = oatpp::mbedtls::Config::createDefaultClientConfigShared();

  auto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, "echo.websocket.org", 443);

  auto connector = oatpp::websocket::Connector::createShared(connectionProvider);

  auto connection = connector->connect("/");

  socket = new oatpp::websocket::WebSocket(connection, true /* maskOutgoingMessages must be true for clients */);

  socket->setListener(std::make_shared<ClientWebSocketListener>());

  std::thread thread(socketTask);

  for(v_int32 i = 0; i < 100; i ++) {
    socket->sendOneFrameText("hello");
    std::this_thread::sleep_for(std::chrono::milliseconds(1000));
  }

  thread.join();

}

}

int main() {
  oatpp::base::Environment::init();
  run();
  oatpp::base::Environment::destroy();
  return 0;
}

Please note. Please put your logs, in order to see the output. Or update to the latest version of oatpp (which has the default logger).

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 28, 2019

@dmcamens-legrand please verify that above code works correctly on your side for both PC and Android. If it does for PC but Android, it might be a problem with MbedTLS build for Android.
You may also try to run tests for oatpp-mbedtls to verify it works correctly.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo The example code is working in Android now. Thanks for your help! Now I am trying to connect to my actual web socket server, and I am getting an exception from Connector::connect. The exception has the following description:

[oatpp::network::client::SimpleTCPConnectionProvider::getConnection()]. Error. Call to getaddrinfo() faild.

I think this might be because I am passing a URL, not only a hostname, into ConnectionProvider::createShared. The URL I need to use is of the following format:

wss://my.host.name/path/to/server?access_token=ABCDE

Is it possible to use a URL of that format?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Hello @dmcamens-legrand ,

You have to do it like this:

...
auto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, "my.host.name", 443 /*default port*/);

auto connector = oatpp::websocket::Connector::createShared(connectionProvider);

auto connection = connector->connect("/path/to/server?access_token=ABCDE");
...
@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo OH thank you! I should have figured that out on my own. Thanks for pointing out my error!

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@dmcamens-legrand

Also in case you need to configure url with one string you may try to use oatpp::network::Url::Parser.

  /* Parse url components */

  auto urlParams = oatpp::network::Url::Parser::parseUrl("wss://my.host.name/path/to/server?access_token=ABCDE");

  oatpp::String host = urlParams.authority.host;
  oatpp::String path = urlParams.path;

  if(!path) {
    path = "/";
  }

  v_int32 port = urlParams.authority.port;

  if(port == -1) {
    if (urlParams.scheme && (urlParams.scheme == "wss" || urlParams.scheme == "https")) {
      port = 443;
    } else {
      port = 80;
    }
  }

  oatpp::String accessToken = urlParams.queryParams["access_token"];
  oatpp::String endpoint = path + "?access_token=" + accessToken;


  /* Connect */

  auto config = oatpp::mbedtls::Config::createDefaultClientConfigShared();
  auto connectionProvider = oatpp::mbedtls::client::ConnectionProvider::createShared(config, host /* parsed host */, port /* parsed port */);
  auto connector = oatpp::websocket::Connector::createShared(connectionProvider);
  auto connection = connector->connect(endpoint /* parsed endpoint = path + access_token */);

Not very comfortable, but that's how it works at the moment.

PS. if its not required to configure URL with one string, I prefer the previous example:)

Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo It works now with your preferred method (not with one string URL). I am not getting any data from the web socket but maybe that is a problem on the server side. I will check the server side.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@dmcamens-legrand

Thanks for keeping me updated.
Please let me know if there are any issues on the client side.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo I almost have it working! I have one question now. How can I send binary data? I see sendOneFrameBinary but it takes a string as input. Can you share an example?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@dmcamens-legrand sendOneFrameBinary is what you need.

char buffer[size];
oatpp::String data((const char*)buffer, size)

It will be a valid binary data.

I will send more detailed example later. I Dont have my laptop with me at the moment.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo It works! Thank you for your help. No need for an example.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo To clean up the created objects (Config, ConnectionProvider, Connector, Connection, WebSocket) do I need to do anything special? I assume at least I need to delete the WebSocket since it was created with "new" but are the other objects "smart pointers"?

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@dmcamens-legrand

I assume at least I need to delete the WebSocket since it was created with "new"

For this case yes, you should delete it manually

but are the other objects "smart pointers"

they should be deleted automatically if they where created as shared_ptr.
In case you created them with call to createShared they are smart pointers (shared_ptr).

Also you may check oatpp::base::Environment for leaked objects:

  /* init env */
  oatpp::base::Environment::init();

  /* run you app */
  run();

  /* Print how much objects were created during app running, and what have left-probably leaked */
  /* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */
  std::cout << "\nEnvironment:\n";

  /* print number of leaked objects */
  std::cout << "objectsCount = " << oatpp::base::Environment::getObjectsCount() << "\n";

 /* how much objects were created during runtime */
  std::cout << "objectsCreated = " << oatpp::base::Environment::getObjectsCreated() << "\n\n";

  /* de-init env */
  oatpp::base::Environment::destroy();

Note: it counts only objects which extend oatpp::base::Countable.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@dmcamens-legrand also
for oatpp::String you may just wrap your binary data in order not to copy it.

char buffer[size];

/* create oatpp::String as copy of the data */
oatpp::String copiedData((const char*)buffer, size);

/* create oatpp::String as wrapper of the data */
oatpp::String wrappedData((const char*)buffer, size, false);
@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Hey @dmcamens-legrand ,

It would be very cool if you create Pull Request with changes you made in order to run oatpp for Android.

Also if you open-source some sample Android app with proper cmake scripts - it would be really great!
So I could reference you example in docs.

Thank you,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@lganzzzo I will definitely do a pull request with my changes. Making a sample Android app is a little bit more difficult for me, especially since I didn't use CMake. I added the required files directly in my Android.mk file. I know that is not ideal but it was the fastest way for me.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Sample app is cool with Android.mk too. If you manage to find time to prepare sample app and open-source it, others can modify it.

In any case thank you for you interest in the project!

Best Regards,
Leonid.

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

@lganzzzo Thank you for all of your help with your great libraries. It is working very well! I opened up PR 78 in the main oatpp repo as you requested. This PR has the changes we made in our fork to remove the compiler errors and warnings. Please let me know if anay of the changes should be done in a different way!

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 31, 2019

@dmcamens-legrand Thank you for the great PR!
BTW, did you manage to build oatpp for iOS ?

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

@lganzzzo Yes we built it for iOS also and tested it too. It is working great so far! We'll let you know if we find any bugs.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented May 31, 2019

Cool!
Closing this thread

@lganzzzo lganzzzo closed this May 31, 2019

@lganzzzo

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

Hello @dmcamens-legrand, @apple-ihack-geek .

Please update your forks for oatpp, oatpp-websocket, oatpp-mbedtls to the 0.19.6 tag.

Summary of changes:

  • Now WebSocket::Listener::readMessage() method also receives an opcode parameter in order to know whether you get text or binary message.
  • Client handshake fixes in order to support different server-side handshake responses.
  • Introduced -DOATPP_COMPAT_BUILD_NO_THREAD_LOCAL build flag. - For iOS 8 compatibility #81

For more details see release notes:

You may also subscribe to oatpp gitter channel for latest news.

Best Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Hi @lganzzzo thank you for letting us know about the changes. We will update it as soon as we can. Right now we are getting ready to make a release. We prefer to wait until our next release so as to not introduce too many changes at this time. If you see the new changes as fixing critical bugs then we can consider it sooner. Let us know if that is the case. Thank you! @apple-ihack-geek FYI.

@lganzzzo

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

Hello @dmcamens-legrand ,

Risks are as follows (for un updated version of oatpp-websocket):

In case you are going to use your websocket client in pair with your own tested server, then I would say there is no critical changes.

However in case client is supposed to work with different servers - you may run into situation that for some servers client would be unable to make a handshake. (In this case I would recommend to update oatpp modules)

Regards,
Leonid

@dmcamens-legrand

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@lganzzzo Thank you for explaining the risks. We are indeed only using it with our own well-known server, so it would appear there is no rush for us to use the latest changes now. We will update it at our next opportunity. I have logged a case in our system so we do not forget about it. @apple-ihack-geek FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.