Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Best HTTP Released

Discussion in 'Assets and Asset Store' started by BestHTTP, Sep 11, 2013.

  1. hermit_021

    hermit_021

    Joined:
    May 31, 2018
    Posts:
    4
    @BestHTTP Hi, I'm using best http 2 for my game. There is strange issue in receiving broadcast.
    There are 2 players on the table when 2nd player joins the table for the first time he doesn't get any broadcast he has to rejoin the table but 1st player gets all broadcast he doesn't have to rejoin.
     
  2. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
    @hermit_021

    It would be very valuable to know what protocol are you using (socket.io, signalr, etc.), and how do you send your broadcasts.
     
  3. hermit_021

    hermit_021

    Joined:
    May 31, 2018
    Posts:
    4

    @BestHTTP, I'm using socket.io. and let me describe it bit more. as I said second player is not getting broadcast but the case is, there are two classes for both i have subscribe the broadcast in onenable one of them is called but not the other one. Both are active in scene in debug i get logs for onenable method from both classes from both players but both methods of that broadcast is called for 1st joined player only 2nd player have to rejoin in order to get call both methods.
     
  4. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
  5. hermit_021

    hermit_021

    Joined:
    May 31, 2018
    Posts:
    4
    upload_2022-10-13_16-13-4.png

    upload_2022-10-13_16-13-25.png

    Both game objects are active and both scripts are also enabled.
     
  6. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
    @hermit_021 I couldn't replicate your issue, and in this case verbose logging wouldn't help as On and Off cals aren't logged. So could you send a minimal repro project?

    Also, please note that calling Off removes all callbacks for that event name!
     
  7. gawoon

    gawoon

    Joined:
    Dec 11, 2017
    Posts:
    7
    @BestHTTP
    hi, here's my context.
    i'm using socketio3 to send my webcamtexture to python server.
    i have a texture which has a resolution about 640x480, and i encoded it to JPG format, and then send it through socketio.
    i profiled with my tablet Lenovo P11, and i'd like to know how to optimize this.
    it seems that zlib take a lot of time.
    is there way not to compress my data before sending?
    any other solution will save me
    thanks in advance.
    upload_2022-11-3_2-19-8.png
     

    Attached Files:

  8. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
    @gawoon The new version in the works can help solving it by
    1. giving a way to disable websocket extensions
    2. moving extension and websocket frame creation to the sender thread

    In your case both will be helpful as JPG already a compressed format, further compression can be only a waste of CPU time, so disabling the per-message deflate extension is a good step to consume less cpu.

    If you drop me a mail at besthttp@gmail.com i can send a package with the new version.
     
    choigw likes this.
  9. choigw

    choigw

    Joined:
    Jul 21, 2020
    Posts:
    2
    awesome!
    here's my email, choigawoon@gmail.com
    also wonder if when do you think new version is released on the package manager?
    oops, i sent the mail to you also.
     
  10. gawoon

    gawoon

    Joined:
    Dec 11, 2017
    Posts:
    7
    hi again.
    your solution work perfectly. thanks a lot!
    before about 100ms -> now about 1-2ms upload_2022-11-4_8-6-41.png
     
    BestHTTP likes this.
  11. 1002711414

    1002711414

    Joined:
    Dec 16, 2021
    Posts:
    1
    Hello,How to Authentication by password and username?
     
  12. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
  13. JosephEgens

    JosephEgens

    Joined:
    May 5, 2020
    Posts:
    3
    @BestHTTP
    Hello,
    I have been experiencing a problem with the BestHTTP package for some time, on some Android devices the HTTPRequest functions and requests with SignalR (HubConnection when sending) crash the application. I did several tests but the application crashes without any particular message on the Play Store (except a SIGBUS and SIGSEGV message and more recently a "[libil2cpp.so] BestHTTP47.cpp - FastChaCha7539Engine_DoFinal_mB94251F11244EE9C50414238F8C1CF04D467191A" message related to a SIGBUS error). I changed the HTTPRequest functions to UnityWebRequest and it works but I haven't found an alternative for SignalR.

    (I would like to point out that this crash only happens to 1% of our users and they all use a Samsung Galaxy A13)

    Thanks in advance for your help!

    Edit : I'm using Unity 2021.3.16f1
     
  14. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
    @JosephEgens What version of the plugin and Unity are you using?
     
  15. JosephEgens

    JosephEgens

    Joined:
    May 5, 2020
    Posts:
    3
    I'm using Unity 2021.3.16f1 and BestHTTP/2 V 2.8.2
     
  16. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,631
    @JosephEgens I saw nothing suspicious in the FastChaCha7539Engine's DoFinal method, however under Unity 2021.2 or newer it uses BouncyCastle's new Span based APIs.
    Drop me a mail at besthttp@gmail.com (or you can join to the plugin's discord server and send a private message) and will send a new package that will disable the Span based APIs so we can see whether it makes any change.
     
  17. JosephEgens

    JosephEgens

    Joined:
    May 5, 2020
    Posts:
    3
    Hello,
    Thank you for your reactivity, with the plugin that you sent me, the requests do not cause any more crashes and work properly.
    Thank you again for your help !
     
    BestHTTP likes this.