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 9247727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:48:17+00:00 2026-06-18T09:48:17+00:00

I am writing server and client based on WebSocket protocol. Server is made using

  • 0

I am writing server and client based on WebSocket protocol.

Server is made using Python and Twisted.

Right now I can send binary data from server to client and back, only problem is that, according to some sources, endianness of binary data sent from browser is based on machine endianness. I want to make sure, is it true?

If it’s true, then should I somehow check what endianness client has and read/send data from/to him using his endianness? What is the best way to check client endianness, just send from client

var view_buffer = new UInt8Array(new ArrayBuffer(1));
view_buffer[0] = 1;

this data, and check on server if it returns 1 or 128?

  • 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-18T09:48:19+00:00Added an answer on June 18, 2026 at 9:48 am

    To check endianess you’d need to send at least a two byte value.

    You can’t check just by sending a single byte because the bit-level endianess has already been sorted out for you at that point.

    Hence the endianess only matters for purposes of byte swapping (if required) and if you’re trying to pack individual bits using endian-specific rules, such as when you use bitfields in C.

    If your question relates to your own messages carried within WebSocket payloads, the usual process is to choose a byte order yourself, and then do whatever packing or unpacking you have to do to convert from the native byte order to your preferred byte order. Most protocols I know of use big-endian, aka “network order”.

    So, if you have a 16 bit value, convert it into two 8-bit bytes yourself with shifts and bitwise operators, and then send the top byte first followed by the second byte. At the server side, reverse that process. Most server side languages make it pretty easy to byte-swap values from network order to native byte order.

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

Sidebar

Related Questions

I'm writing Qt-based client application. It connects to remote server using QTcpSocket . Before
I'm writing a server and client system in python. The purpose of the system
I am writing a client/server program using C sockets. I am specifying that the
I am writing a Java client/server GUI application using sockets and here is the
I am writing http server that can serve big files to client. While writing
This is more of a conceptual question. I'm writing a transactional based server-client application
I am writing a client server iPhone app. The server is J2EE based. I
I'm writing multicast client/server application based on this and this ; which work great.
For learning purposes I am writing a socket based client/server application. I have designed
For learning purposes I am writing a socket based client/server application. I have designed

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.