Page 1 of 1

InitCrypto fails

Posted: 24 Apr 2021, 14:09
by --F--
InitCrypto fails on Unity 2019.4.24 with error:

Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.


Code: Select all

ConfigData cfg = new ConfigData();
cfg.Host = "demo.smartfox.com";
cfg.Port = 9933;
cfg.HttpPort = 8080;
cfg.HttpsPort = 8443;
cfg.Zone = Zone;


It doesn't log to smartfox server so I think It is a unity client api error which I don't have access.

Re: InitCrypto fails

Posted: 26 Apr 2021, 08:09
by Bax
(moved to the appropriate forum section)

What version of the C# API are you using?

Re: InitCrypto fails

Posted: 26 Apr 2021, 08:14
by Lapo
Hi,
can you show us the full stack trace of the client side error?

Have you double checked that the SSL certificate you have deployed works correctly? (i.e. checking by pointing your browser)
Also, can you please check that you don't have server side errors, when this happens?

Thanks

Re: InitCrypto fails

Posted: 20 Dec 2022, 05:55
by Sudarshan
Message: ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

Code: Select all

                       Stacktrace: System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) (at <2e531ccb5a634d41a5f338e40371c5fd>:0)
Sfs2X.Util.ByteArray.WriteBytes (System.Byte[] data, System.Int32 ofs, System.Int32 count) (at <facfabb65458430294cb5e9a75ea8519>:0)
Sfs2X.Util.CryptoInitializer.OnHttpResponse (System.String rawData) (at <facfabb65458430294cb5e9a75ea8519>:0)
Sfs2X.Util.CryptoInitializer+<Run>d__5.MoveNext () (at <facfabb65458430294cb5e9a75ea8519>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <e0b801613d424beca89c0145453da4be>:0)


we are also getting this nonfatal exception on calling this method

Code: Select all

StartCoroutine(smartFox.InitCrypto());
.
what might be the reason? the issue is intermittent and we are getting this nonfatal at a very high frequency from the production app.

The unity we are using is 2019.2.14f1.

Re: InitCrypto fails

Posted: 20 Dec 2022, 08:51
by Lapo
Hi Sudarshan,
it would be best if you could start a new post and provide more details about this issue.
In particular:
- SFS2X version in use
- Unity API version in use
- a description of how the problem is triggered and the steps to reproduce it.

Thanks

Re: InitCrypto fails

Posted: 20 Dec 2022, 11:08
by Sudarshan
Created a ew post here
viewtopic.php?f=20&t=29559