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

  • Home
  • SEARCH
  • 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

I need some help tweaking this php code to print out a default value
I've been thinking about doing my own language (practicality: it's a thought experiment). One
(This question has been downvoted, which I find strange. How have I offended?) Am
I thought I had this all figured out, but now that I'm writing a
I have the following code which uses an array to write the result to
I'm still new to Ruby on Rails and I'm currently having a issue with
I am trying to create a user login/creation script in PHP and would like
I have a Django application being served of (say) example.com . It contains a
I've been slowly teaching myself the fundamentals of interface driven programming and I'm struggling
I just wrote a very simple Expect script for wrapping around rsync, but it

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.