Hi
i have a bug.
SFSObjectLite doesn't support ByteArray transmission.
how to fix that bug?
thank in advance
p/s: my english bad. hope u understand. give me name account skype to i add skype and talk more (
SFSObjectLite doesn't support ByteArray transmission.
Re: SFSObjectLite doesn't support ByteArray transmission.
Hi,
SFSObjectLite is an alternative implementation of SFSObject used for websockets.
At the moment we don't support byte arrays in our websocket API, which is the reason of the error.
If you want to transmit byte data from an HTML application you can convert it to Base64 and send it as a String.
hope it helps
SFSObjectLite is an alternative implementation of SFSObject used for websockets.
At the moment we don't support byte arrays in our websocket API, which is the reason of the error.
If you want to transmit byte data from an HTML application you can convert it to Base64 and send it as a String.
hope it helps
Re: SFSObjectLite doesn't support ByteArray transmission.
u can add my skype: thtienqb to talke more about help me
Re: SFSObjectLite doesn't support ByteArray transmission.
Explain your problem here.
Thanks
Thanks
Re: SFSObjectLite doesn't support ByteArray transmission.
can u give example to convert SFSObjectLite to SFSObject
thank u
thank u
Re: SFSObjectLite doesn't support ByteArray transmission.
I don't understand what you're trying to do.
Normally you don't have to construct SFSObjectLite manually.
Can you give us a bit of context and explain what you're trying to do?
Thanks
Normally you don't have to construct SFSObjectLite manually.
Can you give us a bit of context and explain what you're trying to do?
Thanks
Re: SFSObjectLite doesn't support ByteArray transmission.
Hi Lapo,
We have the same issue with our project.
We have a mobile game (Unity Android/iOS) that uses ByteArrays heavily to send data to and from the server, we prefer that data type as it is more efficient especially if we are just sending integers whose values are less than 256. So we normally pack them together into a byte array and then deserialize it on either end.
Now, the problem is, we are planning to port the game to WebGL and release it on the Facebook platform. We have everything setup including WSS certificate. But when we tested the game (Unity WebGL), we got this error from the console:
NotSupportedException: SFSObjectLite doesn't support ByteArray transmission
Sfs2X.Entities.Data.SFSObjectLite.GetByteArray (System.String key)
And that is how I ended up to this thread looking for some answers.
Is there any plan on supporting ByteArrays for WebGL applications?
We have the same issue with our project.
We have a mobile game (Unity Android/iOS) that uses ByteArrays heavily to send data to and from the server, we prefer that data type as it is more efficient especially if we are just sending integers whose values are less than 256. So we normally pack them together into a byte array and then deserialize it on either end.
Now, the problem is, we are planning to port the game to WebGL and release it on the Facebook platform. We have everything setup including WSS certificate. But when we tested the game (Unity WebGL), we got this error from the console:
NotSupportedException: SFSObjectLite doesn't support ByteArray transmission
Sfs2X.Entities.Data.SFSObjectLite.GetByteArray (System.String key)
And that is how I ended up to this thread looking for some answers.
Is there any plan on supporting ByteArrays for WebGL applications?
"Dream it, I'll code it..."
Lead Developer
Optimal Solution Pte. Ltd.
Lead Developer
Optimal Solution Pte. Ltd.
Re: SFSObjectLite doesn't support ByteArray transmission.
Hi,
yes there are plans, but not imminent as it will take a major rewrite of the API. At the time we started supporting websockets there was no support for byte arrays or byte manipulation in JS.
The rewrite is not going to affect developers though, it's more of a "behind the scenes" rewrite.
Cheers
Is there any plan on supporting ByteArrays for WebGL applications?
yes there are plans, but not imminent as it will take a major rewrite of the API. At the time we started supporting websockets there was no support for byte arrays or byte manipulation in JS.
The rewrite is not going to affect developers though, it's more of a "behind the scenes" rewrite.
Cheers
Re: SFSObjectLite doesn't support ByteArray transmission.
Thanks Lapo.
Do you have any estimated release date on when this can be available so we can decide if we are going to wait for it or just create a workaround solution?
Regarding the workaround, I want to know which is more efficient (in terms of bandwidth usage)
a) Create a SFSObject containing all the bytes in my ByteArray
soData.putByte("KEY", {each element of my ByteArray});
e.g.
soData.putByte("KEY0", MyByteArray[0]);
soData.putByte("KEY1", MyByteArray[1]);
soData.putByte("KEY2", MyByteArray[2]);
etc...
b) Create a SFSObject containing a Hex String equivalent of my ByteArray
e.g. MyByteArray = {255, 254, 253};
soData.putUtfString("KEY", "FF FE FD");
Do you have any estimated release date on when this can be available so we can decide if we are going to wait for it or just create a workaround solution?
Regarding the workaround, I want to know which is more efficient (in terms of bandwidth usage)
a) Create a SFSObject containing all the bytes in my ByteArray
soData.putByte("KEY", {each element of my ByteArray});
e.g.
soData.putByte("KEY0", MyByteArray[0]);
soData.putByte("KEY1", MyByteArray[1]);
soData.putByte("KEY2", MyByteArray[2]);
etc...
b) Create a SFSObject containing a Hex String equivalent of my ByteArray
e.g. MyByteArray = {255, 254, 253};
soData.putUtfString("KEY", "FF FE FD");
"Dream it, I'll code it..."
Lead Developer
Optimal Solution Pte. Ltd.
Lead Developer
Optimal Solution Pte. Ltd.
Re: SFSObjectLite doesn't support ByteArray transmission.
Hi,
at this stage we don't have an estimated release date.
One workaround could be to detect if the client is websocket based and send him slightly different content, for example you could Base64 encode the same binary data you send to other clients.
Detecting a websocket client is simple:
Hope it helps
at this stage we don't have an estimated release date.
One workaround could be to detect if the client is websocket based and send him slightly different content, for example you could Base64 encode the same binary data you send to other clients.
Detecting a websocket client is simple:
Code: Select all
if (user.getSession().getType() == SessionType.WEBSOCKET)
{
...
}
Hope it helps
Re: SFSObjectLite doesn't support ByteArray transmission.
Ok Lapo,
Thanks for the info and suggestions, I will look into the Base64 workaround.
Thanks for the info and suggestions, I will look into the Base64 workaround.
"Dream it, I'll code it..."
Lead Developer
Optimal Solution Pte. Ltd.
Lead Developer
Optimal Solution Pte. Ltd.
Return to “SFS2X HTML5 / JavaScript API”
Who is online
Users browsing this forum: No registered users and 27 guests