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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:44:52+00:00 2026-06-11T08:44:52+00:00

I am sending a fix message over socket connection and recieving within a python

  • 0

I am sending a fix message over socket connection and recieving within a python client.
I know there is a SOH seperating each name=value pair in the data.
But the data when printed(as a string), does not show the SOH. The problem arises because I want to be able to show the ‘|’ or I cannot tell within a regular expression, what the boundaries for the individual fields are.
I have looked at decode(‘hex’), decode(‘uu’) on the recieved string , without much success.
Also the pack/unpack require that you supply a format string(which I would have to do for every type of fix).

I am using the Twisted ClientFactory for the client.

Any suggestions?

Follow Up Question:
I use the repr and pass it to a function to replace the ‘\x01’ with ‘|’.
Now when I pass in the data recieved from the network directly, replace seems to have no affect. However when I copy the output and pass it as a string literal into the same function. It behaves as expected(replaces ‘\x01’ with ‘|’).
I also tried using a re.sub, with exactly the same results( works when passed in as a string literal , but not when passed in directly from the network).
I also printed the value from the network into a file , and compared using vi hex editor , to the string literal. It does not reveal any differences.

Some additional information:
When I print the value from a file and read it back, I am not able to use find on ‘\x01’, implying that replace would not work either(it does not).
When I try to convert this into a byte array , it would appear that each of the ‘\’ , ‘x’ , ‘0’, ‘1’ are interpreted as different bytes, when i iterate over the byte array. Which is strange. either the ‘\x01’ is a string or its not and is hex.

Any suggestions?

thanks

  • 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-11T08:44:53+00:00Added an answer on June 11, 2026 at 8:44 am

    It would appear that replace using ‘\x01’ works on the data coming in over the network(and not the output of repr). I am not sure what the reason is, but this meets my requirement.

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

Sidebar

Related Questions

Sending XML from C# Server and receiving it it in Android Java client This
Within my actor I have to create a class which sends a message to
I do the following: from google.appengine.ext import deferred def send_message(client_id, message): logging.info(sending message...) class
I'm very new to sending data over a serial port through .net and I've
I'm using a mail function which is sending back a message that is contained
The problem I have is that the client is sending me a string of
I created a client and server that connect to each other. The server is
How do you fix a names mismatch problem, if the client-side names are keywords
I'm having problem sending an attachment via email using smtp client. It sends great
I'm writing a game server in Python and a game client in Game Maker

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.