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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:23:48+00:00 2026-05-25T13:23:48+00:00

Question: Is there some sort of time out or interrupt to the socket.accept() function

  • 0

Question: Is there some sort of time out or interrupt to the socket.accept() function in python?


Info:

I have a program that has a child thread bound to a port and constantly accepting and tending and passing them to a queue for the main thread. Right now I’m trying to get the child thread to interrupt so it can deconstruct appropriately. I think it is possible for me to just simply stop the child thread and have the parent deconstruct the child, but there are other times where I want to be able to return early form accept so I just decided that would be the most useful approach.

So, is there a way that I can have a time out or cancel the accept method so the thread can return w/o having something connect to it first?

  • 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-25T13:23:49+00:00Added an answer on May 25, 2026 at 1:23 pm

    You can set the default timeout with

    import socket
    print socket.getdefaulttimeout()
    socket.setdefaulttimeout(60)
    

    AFAIK This will affect all the socket operation

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

Sidebar

Related Questions

Question: I've profiled my Python program to death, and there is one function that
Question: Is anyone out there familiar enough with Komodo Edit to shed some light
Really basic question I'm sure for some of you Java heads out there. I
I am looking for some help. I have found this script that sort of
I'm having a hard time describing a Flash program that uses a sort of
FYI, There is some overlap in the initial description of this question with a
There is a similar question here but it only covers some of the issues
This question was posted on some site. I didnt find right answers there, so
Pretty simple question. I've got some Polygons and GroundOverlays defined in KML. Is there
I am doing some image sampling. What my question is, is there a 'crosshair'

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.