Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:24:49+00:00 2026-06-12T06:24:49+00:00

Im creating a 8 bit unsigned javascript array: var myArray = Uint8Array(64); Manipulating this

  • 0

Im creating a 8 bit unsigned javascript array:

 var myArray = Uint8Array(64);

Manipulating this array on both client and server, then sending it over a socket.io connection. We are writing a game thus the data sent over the wire as small as possible. as socket.io does not support sending binary data is it worth bothering with javascript typed arrays or should we just use normal javascript arrays? will they still be smaller then a native js array?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:24:51+00:00Added an answer on June 12, 2026 at 6:24 am

    NOTE: I will assume that by client you mean the browser. Else, please clarify with more details.

    Socket.io does not support binary data, mainly because it offers different transports, and many of them do not support it.

    However, native websockets DO support Blobs and ArrayBuffers.

    If you really want to go with binary data for efficiency (which, I agree, is the way to go in your case), I think you should consider using websockets instead of socket.io.

    The bad:

    • Only ~55% of users browse the web with a browser that supports websockets.
    • You wouldn’t have the commodities socket.io offers, such as channels, emit and on methods.

    The good:

    • Web sockets API is extremely simple.

    • It will be much more memory efficient. Normally your normal arrays are transferred by first making them a JSON string and then sending them back. This means you’re actually sending a string representation of your array! Instead, here you will send the amount of bytes you would expect (in a more predictable manner, without checking string lengths before sending, but in a more “protocol”-ic way if desired).

    If you decide to use WS, you could check this: http://www.adobe.com/devnet/html5/articles/real-time-data-exchange-in-html5-with-websockets.html

    Else you can just go with JSON.

    Truth be told, if you still go with JSON for socket.io and “universal” support, enable flash transport too, and disable slower transports if the game requires low latency.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating quite a bit of XML with JavaScript which is then processed
This is my first time creating a custom action so I'm a bit lost.
I've struggled with this a good bit this morning; I'm creating what will eventually
Using Delphi XE2 on Win 7 64 bit creating a 32 bit app... In
Having a bit of a problem creating an instance of an object. Bear in
So I am creating a fading gallery and am a bit of a noob
I'm creating a simple Windows Forms application with NHibernate and I'm a bit confused
I am getting a bit confused. I am creating an app with storyboard, and
I'm creating a tableless Rails model, and am a bit stuck on how I
Good morning, A bit of background might help. I'm creating a very simple app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.