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

  • SEARCH
  • Home
  • 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 8634939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:50:52+00:00 2026-06-12T09:50:52+00:00

Im making a HTML 5 chess game. I represent the board with an unsigned

  • 0

Im making a HTML 5 chess game. I represent the board with an unsigned 8bit binary array with a length (size) of 64. As there are 64 positions on a chess bord.

var board = Uint8Array(64);

each chess piece is represented on the board via an (obviously) 8 bit unsigned integer. Then on clients there is a map relating the binary representation of a piece to a textual string e.g:

var pieceMap = { 01: 'BlackKnight', 112: 'WhitePawn', 6: 'BlackRook' ... }

The data is sent over a socket.io connection (lets assume we are using websockets), TCP i think? So the Question is:
Will TCP send my packets as small as the data i feed to it (with TCP overheads) or does TCP have a min packet size and send say my 200byte packet as a 1024byte packet?

why so obsessed with size? i know it does not matter but i use this for the learning experiance, in future games i will use this to lower latency… i know chess does not need to be low latency.

  • 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-12T09:50:53+00:00Added an answer on June 12, 2026 at 9:50 am

    Packets as framed, as per indications of the RFC:

    https://www.rfc-editor.org/rfc/rfc6455#section-5

    The overhead is of up to 10 bytes per message or less PER message fragment. How many bytes are sent per fragment are determined by the payload length (part of the framing). Fragments can be pretty big, though. Unless you’re sending very large messages, I don’t think it will be an issue.

    According to the way framing and fragmentation works, you shouldn’t be sending/receiving 1024 bytes of data if the framing + data are just at around 100 bytes.

    My guess is that some implementations might do it with minor differences, but you shouldn’t concern about a detail like that too much unless you start seeing stress problems withy our application.

    "Premature optimization is the root of all evil" Donald Knuth

    Another detail: if you really wanted to go for very low latency, you would have to start looking into things like using UDP or multicasting. Problem is: websockets does not support these. Reducing the packet sizes is not the only important thing for networking, but only a part of it… and from my experience with socket.io, the CPU becomes the bottleneck with small messages before bandwidth, and RAM might take a big hit too before bandwidth as well when messages are in the low kilobites. Of course, this depends entirely on your application and I’m just talking about empirical experiences.

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

Sidebar

Related Questions

I am wondering if there is any technique out there for making HTML code
I have made an html wizzard for making order. There are four steps, in
Newbie question: I am making a simple html game. It consists of these DIV
I'm making a template for email in html, it works fine in apple email
I am interested in making some sort of HTML page that displays the name
I'm making my own website using html and php, and a database using mysql
I've been making a webpage with php and html following this tutorial . I
I am making a GWT app based off of an HTML mockup. The mockup
I've got an html page from where Im making this call periodically: function logon(id)
I'm currently making a GWT project where I display some HTML in a RichTextArea

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.