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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:05:50+00:00 2026-05-15T02:05:50+00:00

I am doing this in my code, HOST = ‘192.168.1.3’ PORT = 50007 s

  • 0

I am doing this in my code,

HOST = '192.168.1.3'    
PORT = 50007              
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
query_details = {"page" : page, "query" : query, "type" : type}
s.send(str(query_details))
#data = eval(pickle.loads(s.recv(4096)))
data = s.recv(16384)

But I am continually getting EOF at the last line. The code I am sending with,

self.request.send(pickle.dumps(results))
  • 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-05-15T02:05:51+00:00Added an answer on May 15, 2026 at 2:05 am

    s.send is not guaranteed to send every byte you give it; use s.sendall instead.

    Similarly, s.recv is not guaranteed to receive every byte you ask — in that case you need to know by other ways exactly how many bytes you need to receive (e.g., send first the length of the string you’re sending, encoded with the struct module) and you’re responsible for doing the looping yourself to that purpose. There isn’t and cannot be any recvall because stream sockets are not “self-delimiting” in any way — they’re just streams, broken up into totally arbitrary packets of sizes not semantically relevant.

    You shouldn’t ever get an EOF from the recv itself, though of course you can expect to get it in the line you’ve commented out, from the pickle.loads (because its argument may well be only a part of the bytes that the counterpart sent: as explained in the previous paragraph).

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

Sidebar

Related Questions

What is this code doing? Specifically the default(XX) part. I've never seen it before.
I have found myself doing this in my code to 'cache' the work done
So here's what I see this code doing: An array is made A loop
I have this code for doing an ajax request to a webservice: var MyCode
This code produces a mess... What am I doing wrong? cell=$(<td>); if(normal.exam_type==Exam_Boolean) { var
I have some code which is doing this: String transactionId = incoming.getJMSCorrelationID(); when I
What am I doing wrong in this HTML code: <html> <head> </head> <body> <div
I need a quick hand figuring out what this code is doing, and how
Let's say I'm doing a code. This code uses kontextua ads <div class=pread> <div
I have code that does a web-service request. While doing this request I need

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.