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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:08:45+00:00 2026-05-11T14:08:45+00:00

I’m working on a client-server program for the first time, and I’m feeling woefully

  • 0

I’m working on a client-server program for the first time, and I’m feeling woefully inadequate on where to begin for what I’m doing.

I’m going to use Google Protocol Buffers to transfer binary data between my client and my server. I’m going to be using the Python variant. The basic idea, as I understand, is that the client will serialize the data, send it to the server, which will then deserialize the data.

The problem is, I’m really not sure where to begin for sending binary data to the server. I was hoping it’d be something ‘simple’ like an HTTP request, but I’ve been searching around Google for ways to transfer binary data and getting lost in the vast multitude of tutorials, guides and documentation. I can’t even tell if I’m barking up the wrong tree by investigating HTTP transfers (I was hoping to use it, so I could knock it up a notch to HTTPS if security is necessary). I really don’t want to have to go to the level of socket programming, though – I’d like to use the libraries available before turning to that. (I’d also prefer standard Python libraries, though if there’s the perfect 3rd party library I’ll live.)

So, if anyone has a good starting point (or wants to explain a bit themselves) on how a good way to transfer binary data via Python, I’d be grateful. The server I’m running is currently running Apache with mod_python, by the way.

  • 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. 2026-05-11T14:08:46+00:00Added an answer on May 11, 2026 at 2:08 pm

    Any time you’re going to move binary data from one system to another there a couple of things to keep in mind.

    Different machines store the same information differently. This has implication both in memory and on the network. More info here (http://en.wikipedia.org/wiki/Endianness)

    Because you’re using python you can cut yourself some slack here (assuming the client and server will both by in python) and just use cPickle to serialize your data. If you really want binary, you’re going to have to get comfortable with python’s struct module (http://docs.python.org/library/struct.html). And learn how to pack/unpack your data.

    I would first start out with simple line-protocol servers until you get past the difficulty of network communication. If you’ve never done it before it can get confusing very fast. How to issue commands, how to pass data, how to re-sync on errors etc…

    If you already know the basics of client/server protocol design, then practice packing and unpacking binary structures on your disk first. I also refer to the RFCs of HTTP and FTP for cases like this.

    ——-EDIT BASED ON COMMENT——– Normally this sort of thing is done by sending the server a ‘header’ that contains a checksum for the file as well as the size of the file in bytes. Note that I don’t mean an HTTP header, you can customize it however you want. The chain of events needs to go something like this…

    CLIENT: 'UPLOAD acbd18db4cc2f85cedef654fccc4a4d8 253521' SERVER: 'OK' (server splits the text line to get the command, checksum, and size) CLIENT: '010101101010101100010101010etc...' (up to 253521 bytes) (server reasembles all received data into a file, then checksums it to make sure it matches the original) SERVER: 'YEP GOT IT' CLIENT: 'COOL CYA' 

    This is overly simplified, but I hope you can see what I’m talking about here.

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

Sidebar

Ask A Question

Stats

  • Questions 110k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer My main problem is that I need to make server-side… May 11, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer If you want the video to play inside your web… May 11, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Load it into the 12 hive under your layouts directory… May 11, 2026 at 9:31 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.