Search Unity

Best HTTP Released

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

  1. sidebolt

    sidebolt

    Joined:
    Oct 3, 2016
    Posts:
    10
    Hi,

    We are using the WebSocket object and are having problems on iOS when the user switches from a wifi connection to a cellular (LTE) connection using the control center. Sometimes this works fine but other times all subsequent websocket requests just hang. I do not believe they are going out. When the user returns to wifi using control center the websocket requests that were made while on LTE all return. Any quick fixes for this? Right now I am going to try to handle it internally by forcing a websocket close and reconnect if a websocket request does not return after a certain amount of time. For what its worth I have not been able to replicate this problem going from LTE to wifi. Only the other way. This problem does not occur if you exit the range of the wifi and the phone moves you to LTE. A websocket close/error event is received in that case.

    This is on Unity 2017.1.1f1, iOS 10.3.2, iPhone 6.

    Thanks!
     
  2. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @unity_ab

    I would still recommend to try out with KeepAliveDefaultValue set to false, the server may have different settings for https than it had for http.
     
  3. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @sidebolt

    It looks that the TCP connection doesn't know about the lost packets. TCP has a keep alive check mechanism too, but they are - by default - sent out rarely (on windows for example every 24 hours...).
    It's possible to alter these values, and you can do so by checking the lines 481-487 in the \Assets\Best HTTP (Pro)\BestHTTP\PlatformSupport\TcpClient\TcpClient.cs

    Lines 486-487 are commented out as they gave different/unreliable results on different platforms.
     
  4. unity_ab

    unity_ab

    Joined:
    Sep 8, 2017
    Posts:
    4
    Yes, you are right. All work good with KeepAliveDefaultValue = false. But we want to enable keepAlive on clinent. It seems that in our server enabled keepAlive for https.
     
  5. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @unity_ab

    Well, you can set it back to true and you can start to experiment with the MaxConnectionIdleTime. :) Its default value is 20 seconds, you should start by halving it:
    Code (CSharp):
    1. BestHTTP.HTTPManager.MaxConnectionIdleTime = TimeSpan.FromSeconds(10);
     
  6. unity_ab

    unity_ab

    Joined:
    Sep 8, 2017
    Posts:
    4
    In our server we have idle timeout = 60 sec. What idle time we must have on the client? I think server should decided what idle time set to connection. How it works?)
     
  7. cong91

    cong91

    Joined:
    May 31, 2013
    Posts:
    5
    Hi !
    I have some problems in ipv6. My game server use SocketIO. and they send my ipv6. I don't know how to connect ipv6 with best http pro and i can't search example in this case.
    And i try connect with this code but it not working :(
    Use Unity : 5.5.2
    Best HTTP :
    1.10.2 (2017.07.29)

    Please tell me why :(.
    Thanks for support
     
    Last edited: Sep 20, 2017
  8. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @unity_ab

    The client will close the connection after a specified idle time, but if you're sending out request continuously there will be no idle time to the connection and the server will close the connection.
    The plugin however will parse and use the Keep-Alive header, using this header the server can inform the client when it will close the connection.
     
  9. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @cong91

    What error are you receiving? Can you send me the logs after loglevels set to All:
    Code (CSharp):
    1. BestHTTP.HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All;
     
    cong91 likes this.
  10. cong91

    cong91

    Joined:
    May 31, 2013
    Posts:
    5
    Thanks for support. I know my reason. Because my connection haven't IPv6 :3.
    Thanks :3
     
  11. 4fthawaiian

    4fthawaiian

    Joined:
    Dec 18, 2013
    Posts:
    33
    Hi - we've noticed that BestHTTP is dropping its cache files in the persistentdata path. We would like to turn on file sharing, but apple are rejecting based on the fact that non application files are in this path (ie, the cache files). Is it possible to set the location of the cache files?
     
  12. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @4fthawaiian

    You can assign a function to the BestHTTP.HTTPManager.RootCacheFolderProvider delegate to return a new path, something like this:
    Code (CSharp):
    1. BestHTTP.HTTPManager.RootCacheFolderProvider = () => Application.temporaryCachePath;
     
    4fthawaiian likes this.
  13. 4fthawaiian

    4fthawaiian

    Joined:
    Dec 18, 2013
    Posts:
    33
    amazing! Thanks for the tip
     
  14. DiG3

    DiG3

    Joined:
    Apr 10, 2014
    Posts:
    1
    @BestHTTP
    I am trying to send a GET request to a website from behind a proxy.
    The problem I'm encountering seems to happen because the web request is actually sending two messages to the end server instead of a single GET like a browser does.
    Because the first message returns a permission denied the request is closed prematurely by the proxy, raising the following exception: "Remote server closed the connection before sending response header! Previous request state: Processing. Connection state: WaitForRecycle".

    Any way to force BestHTTP to only use a single GET message?

    Thanks in advance.
     
  15. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @DiG3

    The plugin will retry failed GET requests, but you can disable this by setting the request object's DisableRetry property to true:
    Code (CSharp):
    1. var request = new HTTPRequest(new Uri("http://httpbin.org/get"), onRequestFinished);
    2. request.DisableRetry = true;
    3. request.Send();
     
  16. platforms

    platforms

    Joined:
    Aug 27, 2015
    Posts:
    2
    Hi everyone,

    We are using Best HTTP Pro version in our Unity Game. It is working quite good. But sometimes actually very rare times we are receiving some non-fatal errors on Crashlytics logs.

    Anyone has any idea what this is about, and how to prevent these issues.

    The requested address is not valid in this context.
    Non-fatal Exception: SocketException
    0 ??? 0x0 Send (System.Net.Sockets.Socket)
    1 ??? 0x0 Write (System.Net.Sockets.NetworkStream)
    2 ??? 0x0 WriteRecord (Org.BouncyCastle.Crypto.Tls.RecordStream)
    3 ??? 0x0 SafeWriteRecord (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    4 ??? 0x0 FailWithError (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    5 ??? 0x0 Close (Org.BouncyCastle.Crypto.Tls.TlsStream)
    6 ??? 0x0 OnUpdate (BestHTTP.HTTPManager)
    7 ??? 0x0 Write (System.Net.Sockets.NetworkStream)
    8 ??? 0x0 WriteRecord (Org.BouncyCastle.Crypto.Tls.RecordStream)
    9 ??? 0x0 SafeWriteRecord (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    10 ??? 0x0 FailWithError (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    11 ??? 0x0 Close (Org.BouncyCastle.Crypto.Tls.TlsStream)
    12 ??? 0x0 OnUpdate (BestHTTP.HTTPManager)
     
  17. tshadle

    tshadle

    Joined:
    Sep 8, 2017
    Posts:
    2
    Hello all,

    I'm using the BestHTTP Pro WebSocket successfully with the standalone player, but when I switch to WebGL the app fails with the Console message "missing function: WS_Create". That function is defined on line 748 of WebSocket.cs... Any idea what could cause this failure? I haven't found any mention of this problem.

    Thanks
     
  18. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @peakgames

    Tried to reproduce it but i had no luck. As the error itself suggests, it might be a non-fatal error. IL2CPP version for UWP has a similar non-fatal exception in its poll implementation.
     
  19. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @tshadle

    You should check the \Assets\Best HTTP (Pro)\Plugins\WebGL\ folder. This should contain three .jslib files. BestHTTP_WebSocket.jslib contains the WS_Create function and without this file, WebSocket will not work under WebGL.
     
  20. platforms

    platforms

    Joined:
    Aug 27, 2015
    Posts:
    2
    Even it is non-fatal, we want to understand the issue because it is happening quite frequently, and we need to find a solution, we can not leave like this. At least can you give some clue where to look for the solution, because I guess it prevent our players to make socket connection.

    Actually we have couple of very similar issues, could you please advice on these issues.

    TlsFatalAlert
    0 ??? 0x0 EncodePlaintext (Org.BouncyCastle.Crypto.Tls.TlsAeadCipher)
    1 ??? 0x0 WriteRecord (Org.BouncyCastle.Crypto.Tls.RecordStream)
    2 ??? 0x0 SafeWriteRecord (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    3 ??? 0x0 FailWithError (Org.BouncyCastle.Crypto.Tls.TlsProtocol)
    4 ??? 0x0 Close (Org.BouncyCastle.Crypto.Tls.TlsStream)
    5 ??? 0x0 OnUpdate (BestHTTP.HTTPManager)
     
    Last edited: Oct 22, 2017
  21. BJOwlient

    BJOwlient

    Joined:
    Jun 18, 2015
    Posts:
    4
    Hi,
    Is there a way to use BestHTTP in a batchmode script ?
    It seems sent requests never end.
     
  22. tshadle

    tshadle

    Joined:
    Sep 8, 2017
    Posts:
    2
    Thank you! That fixed it.
     
  23. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @peakgames

    Sorry, but couldn't find any clue. Even these stack traces seem to be false.
    Are you calling Abort on requests perhaps?
     
  24. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    67
    Hello!

    I need to download huge size content for my app. I prefer to use BestHTTP instead of writing my own service for this. So I have a question about BestHTTP on pause behaviour.

    Does BestHTTP working on application pause? For Android, if user will switch to another app, is BestHTTP still continue to download files, or it pauses it, or return some connection error?

    Thank you!
     
    Last edited: Oct 25, 2017
  25. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @shoo

    The plugin will not continue the plugin in the background (well, it will, but the OS will close the TCP connection of the background app after some time), and it will produce an error.
     
  26. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    187
    I've had this asset for awhile and now have been exploring its functionality. Would like some direction if possible as its feature rich, much of it I don't understand, and I'm not sure what direction to go.

    What I have been doing is using another asset to make a continuous connection to an external server. With this other asset, I can send messages to my server, modify the server exe to execute other commands like modifying the data sent (ie save something, bounce the message back). A downfall of the current asset I'm using is that with a few thousand concurrent users connected at the same time it often crashes the .exe resulting in all networking to fail afterwards.

    If possible, I would ask for some help in how I can just send a variable to my server with BestHTTP, for instance; an integer, and perform a simple function such as adding +1 to this variable and send this data back. Can BestHTTP do this or am I just confusing you? Browsing the documentation I can see many options to send messages to the server. However, I don't see what I can do on the server side.

    Thank you
     
  27. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @voncarp

    I think your best option would be to use WebSockets. It maintains a continuous connection and lightweight enough to add the least amount of overhead per message. You can also choose between raw binary for better performance.

    On top of the WebSocket, you have to define your own protocol though. If you choose a binary one, you treat the sent data's first byte as the control code.

    Let's say, if the first byte is '1', it means that the remote peer (the client or server) must increment the value you sent in the other bytes:
    Code (CSharp):
    1. enum ControlCodes : byte
    2. {
    3.     NoOperation = 0,
    4.     IncrementInteger = 1,
    5.     DecrementInteger = 2,
    6.  
    7.     // etc.
    8. }
    9.  
    10. void SendIncrementIntegerCommand(WebSocket ws, int integer)
    11. {
    12.     byte[] buffer = new byte[5];
    13.  
    14.     // Set the control code
    15.     buffer[0] = (byte)ControlCodes.IncrementInteger;
    16.  
    17.     // place 'integer' to the buffer
    18.     buffer[1] = (byte)(integer >> 24);
    19.     buffer[2] = (byte)(integer >> 16);
    20.     buffer[3] = (byte)(integer >> 8);
    21.     buffer[4] = (byte)integer;
    22.  
    23.     // reverse only the integer part of the buffer if necessary
    24.     if (BitConverter.IsLittleEndian)
    25.         Array.Reverse(buffer, 1, 4);
    26.  
    27.     // send the buffer
    28.     ws.Send(buffer);
    29. }
    30.  
    31. WebSocket webSocket = new WebSocket(new Uri("ws://" + baseUrl));
    32. webSocket.OnOpen = (ws) =>
    33. {
    34.     Debug.Log("Connected");
    35.  
    36.     // Send our command to the server
    37.     SendIncrementIntegerCommand(ws, 123);
    38. };
    39.  
    40. webSocket.OnMessage = (ws, msg) => Debug.Log("Message: " + msg);
    41. webSocket.OnBinary = (ws, data) => Debug.Log("Binary: " + data.Length);
    42. webSocket.OnErrorDesc = (ws, desc) => Debug.Log("Error: " + desc);
    43. webSocket.OnClosed = (ws, code, msg) => Debug.Log("Closed: " + msg);
    44.  
    45. webSocket.Open();
    And you can listen for incoming commands in the OnMessage or OnBinary events.

    Of course, there's higher level protocols in the plugin like the Socket.IO where it's easier to send and receive 'functions', but they are also add more overhead per message...
     
  28. standlee123

    standlee123

    Joined:
    Sep 17, 2017
    Posts:
    1
    the socket.io part perfect work in localhost and internet hosts
    but not work in lan host for android / ios, like 192.168.0.100/socket.io/ etc...
     
  29. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @standlee123

    Just tested and was able to connect to my local network. Please check your application and firewall settings:
    1.) Your app may not listen on all network interfaces. It possible that you can access it through like localhost/socket.io/ but it doesn't bind to 192.168.0.100.
    2.) Your firewall may prevent to connect to that port.
     
  30. OlivierPons

    OlivierPons

    Joined:
    Sep 20, 2014
    Posts:
    28
    Hi,

    I've just bought BestHTTP Pro.

    Two small questions:

    1. When I launch the BestHTTP Pro SampleSelector scene, it works perfectly, but the width of the sample windows is based on the original width of the application: if you resize it, it ignores the changes, so I have to click on "Maximize on play" to have the sample working. What is strange is that the height is flawlessly taken in account.

    2. When I'm running my code, I often (but not all times) see those lines:

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(87,51): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 87)

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(87,51): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 87)

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(88,51): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 88)

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(88,51): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 88)

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(225,43): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 225)

    Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs(225,43): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

    (Filename: Assets/Scripts/BestHTTP/HTTPUpdateDelegator.cs Line: 225)
     
  31. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @OlivierPons

    1.) Didn't spent too much time on the sample UIs as it's not the plugin main purpose, glitches like this might be there.
    2.) This is caused by an API change in Unity 2017.2, it will be fixed in the plugin's next release.
     
  32. Ikalou

    Ikalou

    Joined:
    Dec 9, 2014
    Posts:
    3
    Hi,

    First of all, thanks for this awesome plugin.

    Reading the documentation, it's not very clear to me what guarantees HTTPRequest makes in terms of order of execution when simultaneously waiting for the coroutine and using a callback function.

    Can anyone shed some light on this? Thanks!
     
  33. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @Ikalou

    By default, even when they are placed in the queue they are processed in the same order as you called the .Send() function. Whether you are using the coroutines or callbacks doesn't matter.

    You can set a priority for requests however, using the HTTPRequest object's Priority property. By default its value is 0, and requests with higher priority value will be processed first.
     
  34. Ikalou

    Ikalou

    Joined:
    Dec 9, 2014
    Posts:
    3
    Sorry, my question wasn't very clear.

    What I meant is: for a given HTTPRequest, is the callback guaranteed to be called (and run to the end) _before_ the coroutine completes? I assume that should be the case, but I'd like to be sure.

    Thanks again for your help.
     
  35. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @Ikalou

    Yes, the callback will be called first. By default callback are dispatched from a Unity Update function, and coroutines are check after all Updates executed. (You can refer to the Unity Manual on execution orders.)

    You can also write a quick test:
    Code (CSharp):
    1. private IEnumerator CoroutineVsCallbackTest()
    2. {
    3.     string url = "http://httpbin.org/get";
    4.  
    5.     HTTPRequest request = new HTTPRequest(new Uri(url), (req, resp) =>
    6.         Debug.Log("In callback. Frame: " + Time.frameCount) );
    7.        
    8.     yield return request.Send();
    9.  
    10.     Debug.Log("After coroutine. Frame: " + Time.frameCount);
    11. }
    It should log the "In callback." first and then the "After coroutine." texts. Frame count should be the same for both.
     
  36. Ikalou

    Ikalou

    Joined:
    Dec 9, 2014
    Posts:
    3
    Thanks, that's exactly what I wanted to know.

    I was worried of the possibility that the callback could have been in some event queue and could fire at some later time/frame.
     
  37. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    163
    Hei there,

    I need a system where I can get notification when the server has new info. WebSocket or socket.io would be ok but the changes are not so frequent, could be none for days...so it seems this process is a bit waste of resources.

    I read about long polling, basically I send a GET request and the server will reply when the request is ready.

    How would I go with BestHTTP?
     
  38. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @fafase

    If you require that notification as soon as possible, i would recommend to use something websockets (or something that uses websockets, like socket.io/signalr), in the long run they will have less overhead than a long polling solution.

    But, if you can live with some delay, you can send out a regular get request to get the notifications every x mins (5, 10, 30 minutes - depending on what delay you can tolerate).
     
  39. blittlstar

    blittlstar

    Joined:
    Apr 12, 2017
    Posts:
    3
    Hi, I wanted to check in on this issue as I'm getting the same stack trace as @peakgames and we are indeed calling abort on requests. It doesn't happen with every abort, so we're assuming it's a specific condition that is being met. This error only seems to be happening when we build for WMR using il2cpp. Also, when it throws this error, it locks up the input that triggered the abort, so it isn't just a benign error. Any thoughts would be appreciated!

    Here's the error:
     
  40. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    163
    Currently, as we are still developing and checking what would be best, we are polling every 5s (and this is not the best). But as there could be full days with nothing happening, I thought WS may not be required and was thinking that long polling could be worth the shot.

    We can leave with some delay, though minutes would be too much. I was hoping for a solution that avoids the constant polling and waste of bandwidth and also avoids ws that is more for realtime communication.

    But I guess ws it will be then.

    Thanks anyway. Your asset has saved us quite some time already.
     
  41. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @fafase

    The problem with long-polling (and regular get requests) that they would add constant overhead, even when there's no data to send back. The client must compose the request, send through the network and the server must parse and process it.

    On the other hand, websocket with a good server with evented IO will eat up very little resources and communication between the server and client will be done only when needed. (Stack Overflow also uses WS to send various updates and notification to the clients)

    I would recommend to set websocket's StartPingThread to true and PingFrequency to a larger value (like 5000 - 5 sec, or even larger) to detect network errors.
     
  42. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    127
    I'm trying to utilize bestHTTP websockets here...however now that I'm sending data through a websocket using the WebSocketFrame, I cannot compile to WebGL because for some reason you have:

    #if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR)

    in all the important class files that utilizes the frames for sending.

    Is there a reason you don't include the WebSocketFrames yet you include WebSockets for webgl?

    ---Edit

    I see this here now:
    Code (CSharp):
    1. #if UNITY_WEBGL && !UNITY_EDITOR
    2.     using System.Runtime.InteropServices;
    3. #else
    4.     using BestHTTP.WebSocket.Frames;
    5.     using BestHTTP.WebSocket.Extensions;
    6. #endif
    Is it not possible to utilze your frames class within webgl? What is the Interop intended for?
     
    Last edited: Nov 10, 2017
  43. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @WrathGames

    That's because under WebGL the plugin must use the underlying browser's implementation and API. Unfortunately, browser's APIs are more restricting than what's possible.All in all, in a browser, you can access functions to send binary or textual data, fine tuned frames are not possible.
     
  44. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    127
    Thank you for the swift reply.

    I am using Binary Frames currently....however I need to go with this route I take it:

    upload_2017-11-10_7-42-29.png

    Does this automatically format into a binary frame, or am I looking at literally a similarity with TCP sockets where I'm just reading the data on the server at raw value (first byte received is the first byte in the data I sent)?

    I'm translating an old Flash Client to Unity which used tcp sockets, so either way at this point is fine since I have the setup to accept both, but I'd like to verify what exactly the difference is in how it sends.

    Really appreciate the fast responses, and sorry that I'm bugging you with half-unrelated webgl / socket stuff to your asset; I'm not experienced with the specifications of web sockets.
     
  45. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @WrathGames

    By sending a byte[] will send it as a binary frame.

    You should construct and send a WebSocketFrame only when you have very special needs (like writing and testing a new WebSocket extension).
     
  46. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hello there !

    With the new SynchronizationContext and the runtime upgrade, do you have any plan to provide methods returning Task instead of using callbacks ? That would make for a really cleaner code overall.
     
  47. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @RDeluxe

    That's one of the reasons I'm waiting for a stable runtime upgrade. :)
     
  48. ccklokwerks

    ccklokwerks

    Joined:
    Oct 21, 2014
    Posts:
    62
    Hi,

    Sorry, I don't *think* I have seen this addressed in the thread, but if I'm mistaken please forgive me.

    I have been using an older version of Unity (5.6.3) and want to update my project to 2017.1. After updating the project and getting a new version of Best HTTP I have hundreds of warnings of the following form:

    "Assets/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs(34,32): warning CS0436: The type `Org.BouncyCastle.Crypto.Digests.RipeMD128Digest' conflicts with the imported type of same name'. Ignoring the imported type definition"

    Is this ignorable? It seems like Unity might be doing something very very wrong to the plugin source code here...
     
  49. BestHTTP

    BestHTTP

    Joined:
    Sep 11, 2013
    Posts:
    1,664
    @ccklokwerks

    It should be Unity. I would recommend to delete the Assets/Best HTTP (Pro)/ folder and reimport the package, Unity messed up something.
     
  50. Jribs

    Jribs

    Joined:
    Jun 10, 2014
    Posts:
    154
    @BestHTTP I see mentioned that pro users can change the http size limit from 256 but I cant figure out how to do that.

    How do I do that?

    Second Question:
    I am using the socket.io implementation with the GearVR. When the gear vr is removed from the head it goes into its sleep mode. After some amount of time (~30-60s) the socket connection is disconnected automatically.

    Is there a way to force it to stay alive through the sleep mode?
     
    Last edited: Nov 20, 2017